Valve metal surface defect detection method based on improved Yolov11, electronic equipment and medium

By improving the Head, Backbone, and Neck layers of the Yolov11 model, and combining the RT-DETR detection head with KAN convolution, the problems of low efficiency and poor reliability in valve metal surface defect detection were solved, achieving high-precision automated detection.

CN121544538APending Publication Date: 2026-02-17DAFENG OKAY FLUID MACHINERY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511636541.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-17

Smart Images

  • Figure CN121544538A_ABST
    Figure CN121544538A_ABST
Patent Text Reader

Abstract

The invention discloses a valve metal surface defect detection method based on improved Yolov11, electronic equipment and a medium. The method can comprise the following steps: improving a Head layer of a Yolov11 model through an RT-DETR detection head; a Backbone layer and a Neck layer of the Yolov11 model are improved through KAN convolution; and carrying out valve metal surface defect detection through the improved Yolov11 model. According to the method, by introducing the RT-DETR detection head and the KAN convolution, the Head layer, the Backbone layer and the Neck layer of the Yolov11 are improved, small defect identification in valve detection can be achieved, metal reflection is effectively restrained in the identification process, and the robustness of the Yolov11 model under the complex background of industrial identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of metal defect detection, and more specifically, to a valve metal surface defect detection method, electronic device, and medium based on an improved Yolov11. Background Technology

[0002] Valves are control components in fluid transport systems, possessing functions such as shut-off, regulation, flow guidance, backflow prevention, pressure stabilization, flow diversion, and overflow / pressure relief. Their primary role is to open and close pipelines, control flow direction, and regulate and control the parameters (temperature, pressure, and flow rate) of the transported medium. Valves' external defects (such as cracks, pinholes, laps, blemishes, mechanical damage, corrosion, missing parts, nameplate and paint peeling, etc.) can directly lead to seal failure, media leakage, and even safety accidents.

[0003] Currently, the mainstream testing methods include mechanical performance testing, chemical composition analysis, traditional machine vision inspection, and non-destructive testing. However, these manual appearance quality inspection methods are inefficient and unreliable. At the same time, in high temperature, high pressure, and corrosive environments (such as chemical pipelines), manual inspection of valve metal surface defects is risky and difficult to fully cover, making it difficult to adapt to the current automation and intelligent development process of the valve manufacturing industry.

[0004] Therefore, it is necessary to develop a valve metal surface defect detection method, electronic equipment, and media based on the improved Yolov11.

[0005] The information disclosed in the background section of this invention is intended only to enhance the understanding of the general background of this invention, and should not be construed as an admission or in any way implying that such information constitutes prior art known to those skilled in the art. Summary of the Invention

[0006] This invention proposes a valve metal surface defect detection method, electronic device, and medium based on an improved YOLOv11. By introducing an RT-DETR detection head and KAN convolution, the head, backbone, and neck layers of YOLOv11 are improved respectively, enabling the identification of minute defects (such as scratches / rust spots) in valve inspection. During the identification process, metal reflection is effectively suppressed, improving the robustness of the YOLOv11 model in complex backgrounds under industrial identification conditions.

[0007] In a first aspect, embodiments of this disclosure provide a method for detecting defects on the metal surface of valves based on an improved Yolov11, including: Improve the Head layer of the Yolov11 model using the RT-DETR detection head; The Backbone and Neck layers of the Yolov11 model are improved using KAN convolution; Valve metal surface defect detection was performed using the improved Yolov11 model.

[0008] Preferably, the RT-DERT detection head is based on the Transformer architecture and includes a backbone network, a hybrid encoder, and a transformer decoder with an auxiliary prediction head.

[0009] Preferably, the hybrid encoder includes an attention-based intra-scale feature interaction module and a neural network-based cross-scale feature fusion module.

[0010] Preferably, the KAN convolution integrates a learnable nonlinear activation function into the convolution through a variable activation function, generates a corresponding feature map for each type of defect feature, and passes it to the next KAN convolution layer.

[0011] Preferably, the KAN convolution is a ChebyKANConv2d convolution using a Chebyshev polynomial as the activation function.

[0012] Preferably, the detection of valve metal surface defects using the improved Yolov11 model includes: The image of the valve surface is input into the improved Yolov11 model; The image of the valve surface is processed by KAN convolution to obtain a multi-scale feature map; The hybrid decoder of the RT-DETR detection head converts the multi-scale feature map into a series of image features; A fixed number of defect image features are selected from the output sequence of the hybrid encoder using IoU-Aware query selection as the initial target query for the converter decoder; The transformer decoder iteratively optimizes the target query for valve metal surface defects to generate bounding boxes and confidence scores.

[0013] Preferably, the improved Yolov11 model outputs bounding boxes with high classification scores and low IoU scores.

[0014] Secondly, embodiments of this disclosure also provide an electronic device, the electronic device comprising: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the valve metal surface defect detection method based on the improved Yolov11.

[0015] Thirdly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned valve metal surface defect detection method based on the improved Yolov11.

[0016] The methods and apparatus of the present invention have other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description

[0017] The above and other objects, features and advantages of the present invention will become more apparent from the more detailed description of exemplary embodiments of the invention in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same parts.

[0018] Figure 1 A flowchart illustrating the steps of a valve metal surface defect detection method based on an improved Yolov11 according to an embodiment of the present invention is shown.

[0019] Figure 2 A diagram of the RT-DERT model architecture according to an embodiment of the present invention is shown.

[0020] Figure 3 A schematic diagram of the deformation mechanism of a hybrid encoder according to an embodiment of the present invention is shown.

[0021] Figure 4 a and Figure 4 b shows schematic diagrams of a single-layer KAN structure and a multi-layer KAN structure according to an embodiment of the present invention.

[0022] Figure 5 An improved Yolov11 network structure diagram according to an embodiment of the present invention is shown.

[0023] Figure 6 A native YOLOv11 detection PR map is shown according to an embodiment of the present invention.

[0024] Figure 7 An improved Yolov11 detection PR map is shown according to an embodiment of the present invention.

[0025] Figure 8 A schematic diagram illustrating the detection effect according to an embodiment of the present invention is shown. Detailed Implementation

[0026] Preferred embodiments of the invention will now be described in more detail. While preferred embodiments of the invention are described below, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0027] To facilitate understanding of the solutions and effects of the embodiments of the present invention, three specific application examples are given below. Those skilled in the art should understand that these examples are merely for the purpose of understanding the present invention, and any specific details therein are not intended to limit the present invention in any way. Example 1

[0028] Figure 1 A flowchart illustrating the steps of a valve metal surface defect detection method based on an improved Yolov11 according to an embodiment of the present invention is shown.

[0029] like Figure 1 As shown, this valve metal surface defect detection method based on the improved Yolov11 includes: Step 101: Improve the Head layer of the Yolov11 model using the RT-DETR detection head; Step 102: Improve the Backbone and Neck layers of the Yolov11 model using KAN convolution; Step 103: Detect defects on the metal surface of the valve using the improved Yolov11 model.

[0030] In one example, the RT-DERT detector head is based on the Transformer architecture, which includes a backbone network, a hybrid encoder, and a transformer decoder with an auxiliary prediction head.

[0031] In one example, the hybrid encoder includes an attention-based intra-scale feature interaction module and a neural network-based cross-scale feature fusion module.

[0032] In one example, the KAN convolution integrates learnable non-linear activation functions into the convolution through a variable activation function, generating a corresponding feature map for each type of defect feature and passing it to the next KAN convolution layer.

[0033] In one example, the KAN convolution is a ChebyKANConv2d convolution using a Chebyshev polynomial as the activation function.

[0034] In one example, valve metal surface defect detection using the improved Yolov11 model includes: Input the image of the valve surface into the improved Yolov11 model; The image of the valve surface is processed by KAN convolution to obtain multi-scale feature maps; The hybrid decoder using the RT-DETR detection head converts the multi-scale feature map into a series of image features; IoU-Aware query selection is used to select a fixed number of defect image features from the output sequence of the hybrid encoder as the initial target query for the converter decoder; The transformer decoder iteratively optimizes the target query for valve metal surface defects to generate bounding boxes and confidence scores.

[0035] In one example, the improved Yolov11 model outputs bounding boxes with high classification scores and low IoU scores.

[0036] Specifically, this invention proposes a valve metal surface defect detection method based on an improved YOLOv11 model. This method aims to address the problems of high cost, low detection efficiency, and strong environmental interference in the detection of metal appearance defects in industrial valves. By introducing an RT-DETR detection head and KAN convolution, the Head, Backbone, and Neck layers of the YOLOv11 model are improved respectively. This enables the identification of minute defects (such as scratches / rust spots) in valve inspection and effectively suppresses metal reflection during the identification process, improving the robustness of the YOLOv11 model in complex backgrounds under industrial conditions.

[0037] Figure 2 A diagram of the RT-DERT model architecture according to an embodiment of the present invention is shown.

[0038] Figure 3 A schematic diagram of the deformation mechanism of a hybrid encoder according to an embodiment of the present invention is shown.

[0039] I. Improving the Head Layer of the Yolov11 Model Using the RT-DETR Detection Head: Existing detection heads in Yolov11 typically employ CNN-based architectures, achieving a reasonable trade-off between detection speed and accuracy. However, these real-time detectors often require NMS (non-maximum suppression) post-processing, a process that is difficult to optimize and lacks robustness, leading to delays in detector inference speed. The RT-DERT detection head, on the other hand, is based on a Transformer architecture, comprising a backbone network, a hybrid encoder, and a transformer decoder with an auxiliary prediction head. When the RT-DERT detection head participates in valve metal detection, it receives multi-scale feature maps (S3, S4, S5) from the last three stages of the backbone network as input to its hybrid encoder. These three types of maps include high-resolution and low-resolution feature maps, recording both local textures of minute pitting and scratches on the metal surface in the dataset, as well as macroscopic information about large metal corrosion areas and the overall morphology of the valve surface. Through a series of variants of different encoders in the hybrid encoder, the multi-scale feature interactions are decomposed into single-scale feature sequences. Each feature sequence encompasses different features in the valve metal surface dataset. Using the self-attention module built into the RT-DERT detection head, each input feature is actively and dynamically learned, ensuring that the same feature is not repeatedly predicted. This gradually improves the accuracy of the Yolov11 model in predicting valve metal surface defects while reducing the model's computational cost. The RT-DERT model architecture is as follows: Figure 2 As shown, the deformation mechanism of the hybrid encoder is as follows: Figure 3 As shown.

[0040] The structural system of the RT-DERT model is as follows: Figure 2 As shown, the RT-DERT detection head consists of a backbone, a hybrid encoder, and a Transformer decoder with an auxiliary prediction head. In the replaced Yolov11 model, the RT-DERT detection head receives multi-scale feature maps S3, S4, and S5 of the Yolov11 Neck output regarding metal defects on the valve surface as input to the hybrid encoder. The hybrid encoder performs intra-scale interaction and cross-scale fusion on the feature maps of different scales, transforming the multi-scale features into a series of image features. Then, IoU-Aware query selection is used to select a fixed number of defect image features from the encoder output sequence as the initial target query for the decoder. Finally, the decoder with the auxiliary prediction head iteratively optimizes the target query for valve metal surface defects to generate bounding boxes and confidence scores.

[0041] exist Figure 3The image showcases the hybrid encoder module of the RT-DERT detector head. The hybrid encoder consists of two modules: an attention-based intra-scale feature interaction (AIFI) module and a neural network-based cross-scale feature fusion (CCFM) module. The base A of the RT-DERT module's hybrid encoder uses the multi-scale transformer encoder from the DINO-R50. Based on encoder A, variant B inserts a single-scale transformer encoder for intra-scale feature interaction; variant C introduces cross-scale feature fusion based on B; variant D decouples the intra-scale interaction and cross-scale fusion of multi-scale features, first using a single-scale transformer to perform intra-scale interaction on S5 in variant D to achieve variant DS5, and then performing cross-scale fusion based on DS5, ultimately completing encoder variant E.

[0042] A comparative experiment was set up under the same environmental variables, and various encoders were used for detection. The performance was then compared, and the results are shown in Table 1. Table 1 Performance Comparison of Different Encoder Variants of the RE-DERT Detector Head encoder variants Average accuracy (%) Number of parameters (M) Inference time (ms) A 43.0 31 7.2 B 44.9 32 11.1 C 45.6 32 13.3 D 46.4 35 12.2 DS5 46.8 35 7.9 E 47.9 42 9.3

[0043] As can be seen from Table 1, this series of variants gradually improves model accuracy while significantly reducing computational costs by decomposing multi-scale feature interactions into two steps: intra-scale interaction and cross-scale fusion.

[0044] Furthermore, when replacing the original YOLOv11 DERT detection head with RT-DERT, the target query method of the final detection head was also changed. The target query in DETR has no explicit physical meaning; it merely selects the Top-K features from the encoder using classification scores for initialization (or only performs location queries). However, due to the inconsistent distribution of classification scores and location confidence, some predicted boxes have high classification scores but are not close to the true bounding boxes. Therefore, when detecting defects on the metal surface of valves, the model ultimately selects boxes with high classification scores and low IoU scores, while discarding boxes with low classification scores and high IoU scores, resulting in false positives or low overall defect detection confidence.

[0045] Therefore, by replacing the original DERT head of YOLOv11 with the RE-DERT head for valve metal surface inspection, the FLOPs during YOLOv11 computation are reduced, and the mAP of the model for detecting defect targets is improved, making the YOLOv11 backbone network more efficient, stable, and reliable in metal surface defect detection tasks.

[0046] II. Improving the Backbone and Neck layers of the Yolov11 model using KAN convolution: KAN convolutional neural network is an emerging neural network architecture based on the Kolmogorov-Arnold theorem, which states that any multivariate continuous function can be represented as a combination of a finite number of univariate functions. Unlike the standard multilayer perceptron (MLP) which places fixed activation functions on nodes (neurons), KAN convolution integrates learnable nonlinear activation functions into the convolution when detecting defects on the metal surface of valves. This generates a corresponding feature map for each type of defect feature and passes it to the next KAN convolution layer, thereby reducing the number of defect parameters used in each channel and improving the Yolov11 network's ability to classify each defect feature on the metal surface.

[0047] Figure 4 a and Figure 4 b shows schematic diagrams of a single-layer KAN structure and a multi-layer KAN structure according to an embodiment of the present invention.

[0048] like Figure 4 a, Figure 4 As shown in b, the structure of KAN convolution is similar to that of CNN. The difference lies in that CNN convolutional layers can only use fixed activation functions such as ReLU, which cannot optimally represent the subtle differences of specific defects on metal surfaces and requires a large dataset to adapt the activation function, resulting in a relatively rigid structure. In contrast, using KAN convolutional layers instead of CNN convolutional layers, after the convolutional layers are flattened, each defect feature can be expressed by KAN or a traditional MLP. Furthermore, the activation function of KAN convolution is a non-linear, learnable function, which can learn the distribution of different defect data from fewer defect samples, thus adapting to the complex defect conditions of valve metal surfaces. This can be seen through the continuous multivariate function proposed by the Kolmogorov-Arnold theorem. The multivariate function F(x1,...,x...) n It can be expressed in the following form:

[0049] In the formula, It maps each input variable Univariate functions, including various activation functions such as B-spline basis functions, SiLU functions, and ReLU functions.

[0050] In the above formula, the outer function takes the sum of the inner functions as input and then sums them again. Graphically, this would be a two-layer neural network. Such a network does not use linear combinations; instead, it directly activates the input variables. Furthermore, these activation functions are learnable, not fixed.

[0051] In the YOLOv11 backbone, convolution is a fundamental operation of Convolutional Neural Networks (CNNs). Its convolutional kernels or filters slide across the input defect data image, using a fixed activation function to calculate the dot product at each location to extract spatial features. However, in valve metal surface defect detection tasks, defects may appear in various forms, such as scratches, corrosion, and pitting. Moreover, these defects, especially in valves with poor lighting conditions, often have low contrast with the background texture. Therefore, detecting the same type of defect often requires using more than one edge detection kernel.

[0052] For example, when detecting scratches, traditional CNN convolutional kernels detect edges from light to dark or dark to light. When the weighted sum of pixels in the local area covered by the kernel (i.e., the activation function input value) is negative and has a large absolute value, it outputs a large positive value; when the activation function input value is positive and large, it outputs a negative value. Therefore, for a given scratch edge, two CNN convolutional kernels are needed to calculate its horizontal and vertical edges separately to obtain and output the pixels of the defect feature map.

[0053] Unlike CNN convolutional neural networks, the KAN convolutional kernel's activation function is adaptive. When detecting scratches, the KAN kernel outputs a large positive value when the weighted sum of pixels in the local region covered by the kernel (i.e., the activation function input value) is negative and has a large absolute value; conversely, it outputs a corresponding large positive value when the input value is positive and large; and it outputs zero or negative values ​​to suppress the response when the input value is near zero (corresponding to edgeless regions). In this way, the same KAN convolutional kernel can detect edges in two directions simultaneously, without needing two different convolutional kernels to obtain the defect feature map, as is required in traditional CNNs. This significantly reduces the parameters required for computation in Yolov11 convolutional layers in valve metal surface detection tasks, allowing for more flexible capture and representation of various defect features on valve metal surfaces.

[0054] In this invention, the Yolov11 model is equipped with the ChebyKANConv2d convolution method, which uses the Chebyshev polynomial as the activation function. It has strong modeling capabilities for complex textures and effectively separates high-frequency defect signals (scratches) from low-frequency background (metallic reflections), making it suitable for valve inspection tasks such as sealing surface wear identification.

[0055] III. Valve Metal Surface Defect Detection Based on Improved Yolov11: Figure 5 An improved Yolov11 network structure diagram according to an embodiment of the present invention is shown.

[0056] In the model training part, an improved version of the Yolov11 network was used, such as... Figure 5As shown. This version replaces the convolutional methods in the Backbone and Neck with KAN convolutional neural networks, and replaces the original DERT detection head with the RT-DETR detection head. Compared with the original Yolov11 network structure, the RT-DETR detection head can provide query selection with minimal uncertainty, improve the confidence of small targets, and, combined with the noise suppression capability of KAN convolution, achieve fully automatic judgment. It optimizes the problems of traditional NMS post-processing, which easily filters out low-confidence small targets (such as valve scratches and rust spots) and the problem of overlapping false detections of dense targets. The KAN convolution used in the improved Yolov11 model is a lightweight computational method. Through the frequency domain sparsity of wavelet transform, it can reduce 60% of invalid computation; at the same time, RT-DETR can shut down some decoder layers in the detection head according to scene requirements, effectively reducing the model's computational load.

[0057] Figure 6 A native YOLOv11 detection PR map is shown according to an embodiment of the present invention.

[0058] Figure 7 An improved Yolov11 detection PR map is shown according to an embodiment of the present invention.

[0059] Using the improved Yolov11 for metal surface defect detection in industrial valves, a significant improvement in defect detection accuracy was observed, with an average mAP increase of approximately 8%. Figure 6 It is the native Yolov11 PR curve for disconnection detection. Figure 7 This is the improved Yolov11 PR curve for broken line identification.

[0060] Figure 8 A schematic diagram illustrating the detection effect according to an embodiment of the present invention is shown.

[0061] Specific test results are as follows: Figure 8 As shown in the figure, the detection result marked "damaged" indicates a defect. Example 2

[0062] This disclosure provides an electronic device, comprising: a memory storing executable instructions; and a processor executing the executable instructions in the memory to implement the above-described valve metal surface defect detection method based on the improved Yolov11.

[0063] An electronic device according to an embodiment of the present disclosure includes a memory and a processor.

[0064] This memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.

[0065] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory.

[0066] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.

[0067] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here. Example 3

[0068] This disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the valve metal surface defect detection method based on the improved Yolov11.

[0069] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the methods described in the foregoing embodiments of the present disclosure are performed.

[0070] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).

[0071] Those skilled in the art should understand that the above description of the embodiments of the present invention is only intended to illustrate the beneficial effects of the embodiments of the present invention, and is not intended to limit the embodiments of the present invention to any of the examples given.

[0072] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.

Claims

1. A valve metal surface defect detection method based on improved Yolov11, characterized by, The application relates to a valve metal surface defect detection method based on an improved Yolov11 model. The head layer of the Yolov11 model is improved by an RT-DETR detection head. The backbone layer and the neck layer of the Yolov11 model are improved by KAN convolution. The valve metal surface defect detection is performed by the improved Yolov11 model.

2. The improved Yolov11-based valve metal surface defect detection method of claim 1, wherein, The RT-DETR detection head is based on a Transformer architecture, and comprises a backbone network, a hybrid encoder and a Transformer decoder with an auxiliary prediction head.

3. The improved Yolov11-based valve metal surface defect detection method of claim 2, wherein, The hybrid encoder comprises a scale-in feature interaction module based on attention and a cross-scale feature fusion module based on a neural network.

4. The improved Yolov11-based valve metal surface defect detection method of claim 1, wherein, The KAN convolution integrates a learnable nonlinear activation function into the convolution through a variable activation function, generates a corresponding feature map for each type of defect feature, and passes the feature map to the next KAN convolution.

5. The improved Yolov11 based valve metal surface defect detection method of claim 1, wherein, The KAN convolution is a ChebyKANConv2d convolution using a Chebyshev polynomial as an activation function.

6. The improved Yolov11 based valve metal surface defect detection method of claim 2, wherein, The valve metal surface defect detection by the improved Yolov11 model comprises the following steps: inputting a picture of a valve surface into the improved Yolov11 model; processing the picture of the valve surface by KAN convolution to obtain a multi-scale feature map; converting the multi-scale feature map into a series of image features by the hybrid decoder of the RT-DETR detection head; selecting a fixed number of defect image features from the output sequence of the hybrid encoder as initial target queries of the Transformer decoder by IoU-Aware query selection; iteratively optimizing the valve metal surface defect target queries of the Transformer decoder to generate a frame and a confidence score.

7. The improved Yolov11 based valve metal surface defect detection method of claim 6, wherein, The improved Yolov11 model outputs a frame with a high classification score and a low IoU score.

8. An electronic device, comprising: The electronic device comprises: a memory storing executable instructions; a processor running the executable instructions in the memory to implement the valve metal surface defect detection method based on the improved Yolov11.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program which is executed by a processor to implement the valve metal surface defect detection method based on the improved Yolov11.