A Machine Vision-Based Method for Defect Detection of Sealing Rings

By combining machine vision with binary classification and semantic segmentation models, the problems of low efficiency and poor accuracy in sealing ring defect detection have been solved, achieving efficient, accurate, and comprehensive detection of sealing rings and reducing harm to workers.

CN115170504BActive Publication Date: 2026-03-06JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, the detection of sealing ring defects relies on manual visual inspection, which is inefficient, unstable, harmful to workers' health, and difficult to accurately identify small defects.

Method used

A machine vision-based approach is employed, combining binary classification and semantic segmentation models to handle the size detection and surface defect detection of sealing rings, respectively. The ResNet50 binary classification network is used to handle large defects, while the HRNet semantic segmentation model handles small defects. Comprehensive detection is achieved through image segmentation and feature extraction.

Benefits of technology

It enables efficient and accurate detection of sealing ring defects, improves detection precision and stability, reduces harm to workers, and is suitable for comprehensive inspection of sealing rings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115170504B_ABST
    Figure CN115170504B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of automated visual inspection technology, specifically relating to a machine vision-based method for detecting defects in sealing rings. The method includes the following steps: Step 1: Acquiring images of sealing rings and performing dimensional inspection on the top-view images; sealing rings with non-compliant dimensions are judged as defective. Step 2: Performing binary classification on images of sealing rings that pass the dimensional inspection; sealing rings with large defects are judged as defective. Step 3: Segmenting the qualified images from Step 2 into N sub-images along the circumference of the sealing ring. Step 4: Inputting the samples from the N sub-images obtained in Step 3 into a semantic segmentation model in parallel for detection, and obtaining the output result for each sub-image. Step 5: Integrating the detection results of the N sub-images; if a defective area is detected, the sealing ring is judged as defective. This method solves the problem of omnidirectional detection of sealing rings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automated visual inspection technology, specifically relating to a method for detecting defects in sealing rings based on machine vision. Background Technology

[0002] Rubber sealing rings are extremely common household items, widely used in fire protection, pharmaceuticals, aviation, piping systems, vehicles, various machinery, home appliances, electronics, and other fields. Sealing rings are often key components ensuring the sealing performance of pipes, valve connections, and other equipment; therefore, surface defects and dimensional issues directly affect the reliability of mechanical equipment operation. Consequently, sealing rings must undergo rigorous testing before leaving the factory and before use.

[0003] For defects such as scratches, burrs, and melts in sealing rings, manual visual inspection has traditionally been used. However, this method is not only physically demanding on workers but also inefficient and unstable. Furthermore, scratches on sealing rings are often small targets with low resolution, requiring workers to inspect them under strong light, which poses a significant health risk. Therefore, there is an urgent need for mechanized and intelligent machine vision quality inspection methods. Summary of the Invention

[0004] This invention addresses the problems in related technologies by proposing a machine vision-based method for detecting surface defects in sealing rings.

[0005] The present invention adopts the following technical solution:

[0006] A machine vision-based method for detecting surface defects in sealing rings, the method comprising the following steps:

[0007] Step 1: Acquire images of the sealing rings and perform dimensional checks on the top view images. Sealing rings that do not meet the dimensional requirements are judged as defective products.

[0008] Step 2: Classify the images of the sealing rings that have passed the size inspection into two categories, and judge the sealing rings with major defects as unqualified products;

[0009] Step 3: Divide the qualified images after binary classification in Step 2 into N sub-images along the circumference of the sealing ring;

[0010] Step 4: Input the samples that were segmented into N sub-images in Step 3 into the semantic segmentation model in parallel for detection, and obtain the output result of each sub-image;

[0011] Step 5: Integrate the detection results of N sub-images. If a defective area is detected, the sealing ring is judged as a defective product.

[0012] Furthermore, the acquisition of the sealing ring image in step 1 specifically includes: a top view image of the plane where the sealing ring is located, an image of the sealing ring from the side and below, and a bottom view image of the plane where the sealing ring is located.

[0013] Furthermore, in step 1, the size detection involves contour recognition of the top view image and minimum rotation matrix fitting to obtain the inner and outer diameter dimensions of the sealing ring.

[0014] Furthermore, the binary classification method in step 2 comprises the following steps:

[0015] 2-1) Divide the top view images of the sealing rings that have passed the dimensional inspection into two categories: one is the image of the sealing ring with small defects that have not melted, and the other is the image of the sealing ring with large defects that have melted.

[0016] 2-2) Use the classified sealing ring images as a binary classification dataset;

[0017] 2-3) Construct a ResNet50 binary classification network and input the binary classification dataset into the ResNet50 binary classification network for training to obtain a trained binary classification model;

[0018] 2-4) Input the image of the sealing ring to be detected into the trained binary classification model for classification and obtain the classification result.

[0019] 5. The omnidirectional defect detection method for valve stem seal defects according to claim 4, characterized in that the method of dividing along the sealing ring in step 3 comprises the following steps:

[0020] 3-1) For the top view, the side view, and the bottom view, the sealing ring is regarded as an ellipse. The parameters of the ellipse are obtained by fitting the minimum bounding rectangle. The N equal division points of the sealing ring are obtained by transforming the polar coordinates and rectangular coordinates.

[0021] 3-2) After mathematical selection, the four vertices of the small images are determined based on the equidistant points on the circle; the equidistant points on the sealing ring circle are used as the vertices of each sub-image, and the positions of all four vertices of the sub-image are determined accordingly; the specific mathematical selection is as follows: the side lengths of the smallest circumscribed rectangle of the sealing ring obtained in step 2-1) above are assigned to a and b respectively; using the equation of the elliptic rectangular coordinate system: And the relationship between polar coordinates and rectangular coordinates: x = asint, y = bcost, take t = [0, 360, / N, 2*360, / N, ..., (N-1)*360, to obtain the specific coordinates of N equally divided points on the ellipse; then take two adjacent equally divided points as a pair of diagonal points of the sub-image, and determine the four vertices of the N sub-images;

[0022] 3-4) Extract N images of the sample to be tested.

[0023] Furthermore, in step 4, the semantic segmentation model is the HRNet semantic segmentation model. The semantic segmentation model is trained to obtain a trained semantic segmentation model. The training process includes dataset annotation, image augmentation, and model training, as detailed below:

[0024] 4-1) Dataset annotation: Defect annotation is performed on a certain number of sample images to be detected to form a sample dataset;

[0025] 4-2) Image enhancement: Rotate, mirror, and add Gaussian noise to the above sample dataset;

[0026] 4-3) Model training: The HRNet semantic segmentation model with ResNet50 classification network as the backbone network is used to train the sample dataset processed in step 4-2).

[0027] Compared with the prior art, the beneficial effects of this invention are as follows:

[0028] (1) It solves the contradiction between the original high resolution of the acquired image and the need to ensure the accuracy of the model in recognizing small defects;

[0029] (2) The constructed hrnet semantic segmentation model can quickly and accurately segment the surface defects of the sealing ring and calculate the location and area of ​​the defect area.

[0030] (3) Binary classification and semantic segmentation detection complement each other. The binary classification model is responsible for solving the problem of large defects in the sealing ring, while the semantic segmentation model focuses on high-precision detection of small defects and flaws, which greatly enhances the detection capability of the algorithm.

[0031] (4) On the one hand, the detection accuracy of the HRNet semantic segmentation model is higher than that of general object detection and classification models. On the other hand, the method of dividing a sealing ring into parts reduces the difference between the side and bottom images and the top view images of the sealing ring, so that one algorithm can solve the problem of all-round detection of the sealing ring well. Attached Figure Description

[0032] Figure 1 A flowchart of a machine vision-based method for detecting surface defects in sealing rings provided in an embodiment of the present invention;

[0033] Figure 2 Non-fusible defect diagram provided for embodiments of the present invention;

[0034] Figure 3 A diagram of a fusion defect provided for an embodiment of the present invention;

[0035] Figure 4 This is a diagram showing the result of dividing the front of the sealing ring into six equal parts according to an embodiment of the present invention.

[0036] Figure 5 This is a top view of the plane containing the vertical sealing ring provided in an embodiment of the present invention;

[0037] Figure 6 A side view of the sealing ring provided in an embodiment of the present invention;

[0038] Figure 7 This is a bottom view of the plane containing the vertical sealing ring, as provided in an embodiment of the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0040] like Figure 1 As shown, this invention discloses a method for addressing surface defects in sealing rings based on machine vision, comprising the following steps:

[0041] Step 1: Acquire images of the sealing ring. The acquired images include a top view of the plane perpendicular to the sealing ring, such as... Figure 5 The image below the side of the sealing ring is as follows Figure 6 A bottom view of the plane containing the vertical sealing ring, as shown below. Figure 7 The dimensions of the sealing ring are detected by performing top view images, including contour recognition and two minimum rotation rectangle fittings, to obtain the inner and outer diameter dimensions of the sealing ring.

[0042] Step 2: Classify the dimensionally acceptable sealing ring images into two categories. Since the melting defects of the sealing rings are large and easy to detect, we first classify the dimensionally acceptable sealing rings into two categories, eliminating the large melting defects, which greatly reduces the computational workload. Specific steps include: dividing the dimensionally acceptable sealing ring images into two main categories, one of which is images of small defects where the sealing ring has not melted (see...). Figure 2 One type is an image of a large defect where the sealing ring has melted (see image). Figure 3 The process involves: using the classified sealing ring images as a binary classification dataset; constructing a ResNet50 binary classification network and inputting the binary classification dataset into the network for training to obtain a trained binary classification model; inputting the sealing ring image to be detected into the trained binary classification model for classification to obtain the classification result.

[0043] The images of the qualified sealing rings after binary classification undergo preprocessing, mainly including image grayscale conversion and image size normalization. Grayscale conversion removes color information while preserving brightness information, significantly reducing computational load. The grayscale conversion formula is as follows:

[0044] Gray = 0.1140*B + 0.5870*G + 0.2989*R, where gray is the grayscale value, and R, G, and B are the color components.

[0045] Step 3: After preprocessing, in order to detect shallow and small defects in the sealing ring, the sealing ring image in this example, including the bottom view image, the side-bottom image, and the bottom view image, is segmented into six sub-images. Specifically, the sealing ring is considered as an ellipse, and the parameters of the ellipse are obtained by fitting the minimum bounding rectangle. The specific segmentation method is as follows:

[0046] Assign the side lengths of the smallest bounding rectangle to a and b respectively; then transform the original rectangular coordinate system with the top left corner as the origin into a rectangular coordinate system with the center of the rotating rectangle of the sealing ring as the origin; use the equation of the elliptical rectangular coordinate system: The relationship between polar coordinates and rectangular coordinates is as follows: x = asint, y = bcost. Taking t = [0, 360° / N, 2 * 360° / N, ..., (N-1) * 360° / N], we obtain the specific coordinates of N equally divided points on the ellipse. Then, we take two adjacent equally divided points as a pair of diagonal points of the sub-image. Finally, based on the above diagonal points, we determine another pair of diagonal points, ensuring that the above four points can contain a 1 / N sealing ring. Each sub-image is then extracted based on these four points.

[0047] Step 4: Use the labeling software LabelMe to label the sub-image, marking the type and region of defects, forming a corresponding JSON labeling file, and save the original image and the labeling file in the img folder and json folder of the target folder, respectively.

[0048] In this example, N is set to 6. See also Figure 4 This is a diagram showing the result of dividing the front of the sealing ring into six equal parts.

[0049] Segmentation model training:

[0050] 1) When training a convolutional neural network, a small dataset may lead to overfitting. To increase the model's generalization ability, data augmentation is necessary. Data augmentation methods include image rotation, mirroring, and adding Gaussian noise.

[0051] The sample dataset was divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0052] 2) Construct the HRNet semantic segmentation model, input the dataset into the constructed network for training, and set the parameters as follows: batch size is 4, initial learning rate is 0.001, and maximum number of training iterations is 10000.

[0053] Step 5: Integrate the prediction results of each sub-image to determine whether the sealing ring is a qualified or unqualified product.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting surface defects of a sealing ring based on machine vision, characterized in that, The method comprises the following steps: Step 1: Collecting the gasket image and detecting the size of the top view image, and the gasket with unqualified size is judged as unqualified product, the collecting of the gasket image specifically comprises: the top view image perpendicular to the plane where the gasket is located, the image below the side of the gasket and the upside-down image perpendicular to the plane where the gasket is located; the size detection is to perform contour recognition on the top view image and perform minimum rotation matrix fitting to obtain the inner and outer diameter size of the gasket; Step 2: Classifying the gasket image with qualified size into two categories, and the gasket with large defects is judged as unqualified product, the specific steps of the two classification are as follows: 2-1) The top view image of the gasket with qualified size is divided into two categories, one is the small defect image of the gasket without melting, and the other is the large defect image of the gasket with melting; 2-2) The classified gasket image is used as a data set for two classification; 2-3) Constructing a resnet50 two-classification network, and inputting the two-classification data set into the resnet50 two-classification network for training to obtain a trained two-classification model; 2-4) Inputting the gasket image to be detected into the trained two-classification model for classification to obtain the classification result; Step 3: The image classified in step 2 is divided into N sub-images along the circumferential direction of the gasket, and the specific steps are as follows: 3-1) For the top view image, the side down image and the upside-down image, the gasket is regarded as an ellipse, the parameters of the ellipse are obtained by fitting the minimum circumscribed rectangle, and the N equidistant points of the gasket are obtained according to the polar coordinate and rectangular coordinate transformation; 3-2) After mathematical screening, the four vertices of the cutting subgraph are determined based on the equal division points on the circle; the equal division points on the sealing ring circle are used as the vertices of each sub-image, and all four vertex positions of the sub-image are determined accordingly; wherein the mathematical screening is as follows: the side length of the minimum circumscribed rectangle of the sealing ring obtained in step 2-1) is assigned to a and b respectively; using the elliptical rectangular coordinate system equation: and the relationship between the polar coordinate system and the rectangular coordinate system: x = asint, y = bcost, taking , the specific coordinates of N equal division points on the ellipse are obtained; then taking the adjacent two equal division points as a pair of opposite vertices of the sub-image, and determining the four vertices of the N sub-images; 3-4) Cutting out N sample pictures to be detected; Step 4: The sample divided into N sub-images in step 3 is input into a semantic segmentation model in parallel for detection, and the output result of each sub-image is obtained; Step 5: Integrating the detection results of the N sub-images, if a defective area is detected, the gasket is judged as unqualified product.

2. The machine vision-based sealing ring surface defect detection method according to claim 1, wherein, The semantic segmentation model in step 4 is an hrnet semantic segmentation model, the semantic segmentation model is trained to obtain the trained semantic segmentation model, and the training process comprises data set labeling, image enhancement and model training, which are specifically as follows: 4-1) Data set labeling: labeling defects on a certain number of sample images to be detected to form a sample data set; 4-2) Image enhancement: rotating, mirroring and adding Gaussian noise to the sample data set; 4-3) Model training: training the hrnet semantic segmentation model with resnet50 classification network on the sample data set processed in step 4-2).

Citation Information

Patent Citations

  • Bearing ring appearance defect detection method

    CN111062919A

  • Product detection method and device, electronic equipment and storage medium

    CN111833303A