Steel cable surface wear detection method and device based on improved YOLOv8n-seg model

By improving the YOLOv8n-seg model, the adaptive nuclear convolution and multi-scale convolution attention module are introduced, which solves the efficiency and accuracy problems in wire rope surface wear detection, and realizes efficient and accurate detection of wire rope surface wear, which is suitable for wire rope detection in complex backgrounds.

CN120580201APending Publication Date: 2025-09-02CHINA JILIANG UNIV +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510657235.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

The prior art has problems such as low efficiency, insufficient accuracy and high error detection rate in wire rope surface wear detection. It is difficult to accurately detect complex backgrounds and irregular wear characteristics, and traditional convolution operations cannot adapt to multi-scale and shape changes.

Method used

Using the improved YOLOv8n-seg model, by introducing the adaptive nuclear convolution module (AKConv), convolutional self-attention mechanism (ACmix) and multi-scale convolutional attention module (MSCA), the improved model is constructed to enhance feature extraction capabilities and capture the diversity and complexity of the wear characteristics of the cable surface.

Benefits of technology

It realizes efficient and accurate detection of steel cable surface wear, improves detection accuracy and robustness, and can quickly and accurately identify wear areas under complex backgrounds, meeting the real-time and accuracy requirements of industrial-grade inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580201A_ABST
    Figure CN120580201A_ABST
Patent Text Reader

Abstract

The invention discloses a steel cable surface wear detection method and device based on an improved YOLOv8n-seg model, and relates to the field of steel cable surface wear detection.The method comprises the steps that a steel cable surface image is collected, the real wear area and degree are marked, and a wear image data set is constructed; improving a YOLOv8n-seg model structure, replacing a traditional convolution module in a backbone network with an adaptive kernel convolution module, inserting a convolution self-attention mechanism module in front of a fast spatial pyramid pooling module, and introducing a multi-scale convolution attention module into a neck network; training an improved model by using the wear image data set; and inputting a to-be-detected image into the trained improved model, and outputting a predicted wear area and degree. By improving the structure of the YOLOv8n-seg model, the problems of missing detection and false detection of a traditional method are solved, and high-precision and high-efficiency steel cable wear detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of steel cable surface wear detection, and in particular to a steel cable surface wear detection method and device based on an improved YOLOv8n-seg model. Background Art

[0002] In recent years, with the rapid increase in the number of large-scale ropeway amusement facilities and the continuous rise in labor costs, traditional manual maintenance methods have gradually become irrational, and maintenance costs have continued to increase. At the same time, manual maintenance has shortcomings such as low efficiency, strong subjectivity, and susceptibility to environmental influences, making it difficult to meet the high safety and reliability requirements of modern large-scale amusement facilities.

[0003] Against this backdrop, the widespread adoption of machine vision technology has provided a new solution for cableway inspections. Using drones equipped with high-definition cameras for cableway inspections can quickly capture image information of the cableway surface, significantly improving inspection efficiency and accuracy.

[0004] However, how to accurately and efficiently detect worn areas from a large number of cableway surface images taken by drones remains a technical challenge. Image processing methods in related technologies are prone to missed detections or false detections when dealing with complex backgrounds and irregular wear features. In addition, standard convolution operations are limited by the local receptive field and cannot capture long-distance dependent global information. Its fixed-size convolution kernel is difficult to adapt to the diverse scales and shapes of wear features, and the number of parameters increases quadratically with the increase in size. This results in the model's insufficient ability to process multi-scale, long-distance dependent wear features, making it difficult to meet the real-time and accuracy requirements of industrial-grade detection.

[0005] Therefore, this application proposes an improved YOLOv8n-seg model to achieve efficient and accurate detection of steel cable surface wear. Summary of the Invention

[0006] The purpose of this application is to provide a method and device for detecting wire rope surface wear based on an improved YOLOv8n-seg model, which can realize efficient and accurate detection of wire rope surface wear, so that maintenance personnel can perform maintenance on the wire ropeway according to the wear detection result data.

[0007] To achieve the above objectives, this application provides the following solutions:

[0008] In a first aspect, the present application provides a method for detecting surface wear of a steel cable based on an improved YOLOv8n-seg model, comprising:

[0009] Collecting an image of the steel cable surface and marking the actual wear area and the actual wear degree in the image;

[0010] Performing data enhancement on the image, and forming a steel cable surface wear image dataset together with the annotated real wear area and real wear degree in the image;

[0011] The adaptive kernel convolution module replaces the traditional convolution module in the YOLOv8n-seg model backbone network, and the convolutional self-attention mechanism module is inserted before the fast spatial pyramid pooling module in the backbone network. The multi-scale convolutional attention module is introduced in the neck network to construct an improved YOLOv8n-seg model.

[0012] The improved YOLOv8n-seg model is trained using the steel cable surface wear image dataset to obtain a trained improved YOLOv8n-seg model;

[0013] The image of the surface of the steel cable to be inspected is input into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected.

[0014] In a second aspect, the present application provides a wire rope surface wear detection device based on an improved YOLOv8n-seg model, comprising:

[0015] An image acquisition and annotation module, for acquiring images of the surface of the steel cable and annotating the actual wear area and the actual wear degree in the images;

[0016] a data set construction module, configured to perform data enhancement on the image and construct a steel cable surface wear image data set together with the annotated real wear areas and real wear degrees in the image;

[0017] A model improvement and construction module, which replaces the traditional convolution module in the YOLOv8n-seg model backbone network with an adaptive kernel convolution module and inserts a convolutional self-attention mechanism module before the fast spatial pyramid pooling module in the backbone network; introduces a multi-scale convolutional attention module in the neck network to build an improved YOLOv8n-seg model;

[0018] The model training module is used to train the improved YOLOv8n-seg model using the steel cable surface wear image dataset to obtain a trained improved YOLOv8n-seg model;

[0019] The wear prediction module is used to input the image of the surface of the steel cable to be inspected into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected.

[0020] According to the specific embodiments provided in this application, this application has the following technical effects:

[0021] This application provides a method and device for detecting steel cable surface wear based on an improved YOLOv8n-seg model. This improved YOLOv8n-seg model is constructed by replacing the traditional convolution module in the YOLOv8n-seg model's backbone network with an adaptive kernel convolution module, inserting a convolutional self-attention mechanism module before the fast spatial pyramid pooling module in the backbone network, and introducing a multi-scale convolutional attention module in the neck network. The adaptive kernel convolution module dynamically adjusts the size and shape of the convolution kernel based on input features, thereby better capturing the diversity and complexity of steel cable surface wear features. The convolutional self-attention mechanism module enhances the model's focus on key feature areas, improving the accuracy of feature extraction. The multi-scale convolutional attention module further enhances the model's ability to perceive wear features at different scales, thereby resolving the issues of inaccurate feature extraction and insufficient attention to key areas in the traditional YOLOv8n-seg model when handling complex steel cable surface wear detection tasks, thereby achieving efficient and accurate extraction of steel cable surface wear features. By feeding images of the steel cable surface to be inspected into the trained improved YOLOv8n-seg model, the model can output the predicted wear area and degree of wear on the surface. This process leverages the improved model's powerful feature extraction and precise detection capabilities, addressing the low accuracy and high false positive rate of traditional detection methods in practical applications. It enables rapid and accurate detection of steel cable surface wear, providing strong support for ensuring the safety and reliability of large-scale amusement facilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is an application environment diagram of a wire rope surface wear detection method based on an improved YOLOv8n-seg model in one embodiment of the present application;

[0024] Figure 2 A schematic diagram of a first flow chart of a method for detecting surface wear of a steel cable based on an improved YOLOv8n-seg model provided in one embodiment of the present application;

[0025] Figure 3 A second flow chart of a method for detecting surface wear of a steel cable based on an improved YOLOv8n-seg model provided in another embodiment of the present application;

[0026] Figure 4A third flow chart of a method for detecting surface wear of a steel cable based on an improved YOLOv8n-seg model provided in another embodiment of the present application;

[0027] Figure 5 A schematic diagram of the network structure of an improved YOLOv8n-seg model provided in one embodiment of the present application;

[0028] Figure 6 A schematic diagram of the structure of an adaptive kernel convolution module in an improved YOLOv8n-seg model provided in one embodiment of the present application;

[0029] Figure 7 A schematic diagram of the structure of a convolutional self-attention mechanism module in an improved YOLOv8n-seg model provided in one embodiment of the present application;

[0030] Figure 8 A schematic diagram of the structure of a multi-scale convolutional attention module in an improved YOLOv8n-seg model provided in one embodiment of the present application;

[0031] Figure 9 A schematic diagram comparing an original steel cable image and a wear prediction image obtained by an improved YOLOv8n-seg model provided in one embodiment of the present application; wherein, Figure 9 (a) is the image of the steel cable to be detected; Figure 9 (b) Wear prediction image obtained by improving the YOLOv8n-seg model;

[0032] Figure 10 A schematic diagram showing a comparison between the area of ​​the worn steel cable region in the steel cable image to be inspected and the area of ​​the entire steel cable region in the steel wire rope to be inspected provided in one embodiment of the present application;

[0033] Figure 11 A schematic diagram showing different degrees of wear and tear according to an embodiment of the present application;

[0034] Figure 12 A schematic diagram of the functional modules of a wire rope surface wear detection device based on an improved YOLOv8n-seg model provided in another embodiment of the present application;

[0035] Figure 13 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0036] First, some technical terms involved in the embodiments of this application are introduced.

[0037] In the prior art, ropeway surface wear detection methods primarily rely on traditional manual inspection and some image processing techniques based on standard convolution operations. These methods have numerous drawbacks: manual inspection is inefficient, highly subjective, and easily affected by the environment, making it difficult to meet the high safety and reliability requirements of modern large-scale amusement facilities. Traditional image processing methods are prone to missed or false detections when dealing with complex backgrounds and irregular wear features. Furthermore, standard convolution operations are limited to local windows and cannot capture information from other locations. Their sampling shape is fixed and unsuitable for wear features of varying scales and shapes. The convolution kernel size is fixed at a k×k square, and the number of parameters increases quadratically with increasing size, making it hardware-intensive. This is particularly problematic when dealing with irregular sample shapes. Existing methods combining convolution and self-attention still treat the two as distinct components, failing to fully explore the potential relationships between them, resulting in high computational overhead.

[0038] The YOLOv8n-seg model is a lightweight instance segmentation model, optimized based on the YOLOv8 architecture and developed specifically for real-time object detection and pixel-level segmentation tasks. This model, with YOLOv8n at its core, expands upon traditional object detection capabilities by introducing a segmentation head, enabling it to simultaneously output object bounding boxes, class probabilities, and high-precision segmentation masks. Its backbone network utilizes the efficient CSPDarknet architecture, combining cross-stage local connections and depthwise separable convolutions to extract multi-level features while reducing computational complexity. The neck network utilizes a bidirectional feature fusion mechanism combining Feature Pyramid Networks (FPN) and Path Aggregation Networks (PANet) to enhance multi-scale feature expression capabilities and effectively capture the morphological characteristics of slender, worn steel cable surfaces. The detection head utilizes a decoupled architecture, decoupling classification, regression, and segmentation tasks. Instance segmentation is achieved through prototype mask generation and dynamic matching of detection boxes. The model significantly improves small target detection performance through adaptive anchor box calculation and dynamic positive sample allocation strategies. Combined with the SPPF (Spatial Pyramid Pooling Fast) layer's rapid pyramidal fusion of multi-scale contextual information, it achieves both high inference speed and segmentation accuracy in industrial scenarios, making it particularly suitable for real-time wire rope wear analysis in resource-constrained environments such as drone imagery. Although the original YOLOv8n-seg model has performed well in industrial scenarios, when it comes to actual wire rope surface wear detection, the model still has certain limitations in terms of feature extraction accuracy and its ability to identify slender wear areas, given the irregular wear characteristics of the wire rope surface and the complex background requirements.

[0039] Therefore, the present invention proposes a wire rope surface wear detection method based on improved YOLOv8n-seg, and improves the YOLOv8n-seg algorithm by introducing adaptive kernel convolution (Adaptive Kernel Convolution, AKConv), convolution self-attention mechanism (Amixed model ofboth self-Attention and Convolution, ACmix) and multi-scale convolutional attention (Multi-Scale Convolutional Attention, MSCA) modules, thereby effectively solving the above-mentioned shortcomings, achieving the purpose of improving detection efficiency and accuracy and providing maintenance personnel with accurate wear information. Although the number of parameters of the final model increases, AKConv supports linear increase and decrease in the number of convolution parameters, which helps to optimize performance in a hardware environment and is particularly suitable for the application of lightweight models, thereby reducing model parameters and computational overhead without sacrificing performance.

[0040] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0041] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0042] The wire rope surface wear detection method based on the improved YOLOv8n-seg model provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the image of the steel cable surface to the server 104. After the server 104 receives the image of the steel cable surface, the server 104 marks the real wear area and the real wear degree in the image; performs data enhancement on the image, and together with the marked real wear area and the real wear degree in the image, constitutes a steel cable surface wear image dataset; replaces the traditional convolution module in the YOLOv8n-seg model backbone network with an adaptive kernel convolution module, and inserts a convolution self-attention mechanism module before the fast spatial pyramid pooling module in the backbone network; introduces a multi-scale convolution attention module into the neck network to construct an improved YOLOv8n-seg model; uses the steel cable surface wear image dataset to train the improved YOLOv8n-seg model to obtain a trained improved YOLOv8n-seg model; inputs the image of the steel cable surface to be detected into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the steel cable surface to be detected. The server 104 can feed back the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected to the terminal 102. In addition, in some embodiments, the steel cable surface wear detection method based on the improved YOLOv8n-seg model can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly predict the wear area and wear degree based on the image of the steel cable surface to be inspected, or the server 104 can obtain the image of the steel cable surface to be inspected from the data storage system and predict the wear area and wear degree based on the image of the steel cable surface to be inspected.

[0043] Terminal 102 may be, but is not limited to, various desktop computers, laptops, smartphones, tablet computers, IoT devices, and portable wearable devices. IoT devices may include smart TVs, etc. Portable wearable devices may include smart watches, smart bracelets, head-mounted devices, etc. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers, or may be a cloud server.

[0044] In an exemplary embodiment, Figure 2 As shown, a method for detecting surface wear of a steel cable based on an improved YOLOv8n-seg model is provided. The method is executed by a computer device, specifically a computer device such as a terminal or a server, or a terminal and a server. In the embodiment of the present application, the method is applied to Figure 1The server 104 in the example is used as an example to illustrate the process, including the following steps 201 to 205.

[0045] Step 201 : Capture an image of the surface of the steel cable and mark the actual wear area and the actual wear degree in the image.

[0046] Step 202: perform data enhancement on the image, and form a wire rope surface wear image dataset together with the annotated real wear area and real wear degree in the image.

[0047] In step 203, the traditional convolution module in the backbone network of the YOLOv8n-seg model is replaced by the adaptive kernel convolution module, and the convolution self-attention mechanism module is inserted before the fast spatial pyramid pooling module in the backbone network; the multi-scale convolution attention module is introduced into the neck network to construct an improved YOLOv8n-seg model.

[0048] Step 204: Use the wire rope surface wear image dataset to train an improved YOLOv8n-seg model to obtain a trained improved YOLOv8n-seg model.

[0049] In step 205 , the image of the surface of the steel cable to be inspected is input into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected.

[0050] By implementing the above steps 201 to 205, the present application improves the YOLOv8n-seg model network structure to address the problems of irregular shape of wire rope wear and inaccurate boundary segmentation of wire rope wear, and can achieve more accurate pixel-level segmentation of wire rope surface wear.

[0051] In another exemplary embodiment of the present application, performing data enhancement on the image in step 202 specifically includes:

[0052] Data augmentation is performed on the images by randomly flipping, scaling, color adjustment, and noise addition.

[0053] In another exemplary embodiment of the present application, the adaptive kernel convolution module in step 203 specifically includes: a two-dimensional convolution layer, a resampling layer, a reshaping layer, a one-dimensional convolution layer, a normalization layer and an activation function layer connected in sequence.

[0054] The two-dimensional convolutional layer is used to generate an offset using the following formula and dynamically adjust the sampling coordinates based on the offset:

[0055]

[0056] Where ΔP nIndicates the offset of the nth sampling point, Conv represents the convolution operation, represents the input feature map of the image, Represents a real number matrix, C represents the number of channels of the image, H represents the height of the image, W represents the width of the image, and p0 represents the center position coordinate of the convolution kernel sliding on the input feature map. Indicates the sampling coordinates of the nth sampling point after adjustment, P n Indicates the initial sampling coordinates of the nth sampling point.

[0057] The resampling layer is used to resample the input feature map using bilinear interpolation according to the adjusted sampling coordinates, extract local feature blocks of different scales, shapes and positions on the cable surface; and integrate all the extracted local feature blocks through channel splicing to obtain an integrated feature map.

[0058] The integrated feature map is reshaped by the reshaping layer, re-convolved by the one-dimensional convolution layer, and standardized by the standardization layer, and then input into the activation function layer to obtain an adaptive wear feature map.

[0059] In another exemplary embodiment of the present application, the convolutional self-attention mechanism module in step 203 specifically includes: three 1×1 convolutional layers, a fully connected layer, a convolutional attention path layer, a self-attention path layer, two connection layers and a residual connection layer.

[0060] The adaptive wear feature map is projected through three 1×1 convolutional layers to obtain multi-scale features.

[0061] The multi-scale features are reshaped into N blocks to form an intermediate feature set containing 3×N sub-feature maps; each sub-feature map contains one-third of the number of channels of the adaptive wear feature map.

[0062] The intermediate feature set is input into the convolutional attention path layer through the fully connected layer, and the intermediate feature set is directly input into the self-attention path layer to obtain the convolutional attention output feature map and the self-attention output feature map respectively.

[0063] The convolutional attention output feature map and the self-attention output feature map are respectively input into the residual connection layer after passing through a connection layer. The residual connection layer is used to perform a weighted summation of the convolutional attention output feature map and the self-attention output feature map using the following formula to obtain a weighted fusion wear feature map:

[0064] F out =αF att +βF conv .

[0065] Among them, F out represents the weighted fusion wear feature map, F attRepresents the self-attention output feature map, F conv represents the convolutional attention output feature map, α and β are the first and second constants respectively.

[0066] As an optional implementation, the intermediate feature set is directly input into the self-attention path layer to obtain the self-attention output feature map, which specifically includes:

[0067] Through the self-attention path layer, the sub-feature maps of the three 1×1 convolutional layers in the intermediate feature set are divided into a Query sub-feature map set, a Key sub-feature map set, and a Value sub-feature map set.

[0068] Traverse the Query sub-feature map set, calculate the dot product similarity between each pixel of the current sub-feature map and all pixels of the corresponding sub-feature map in the Key sub-feature map set, and generate an attention score.

[0069] The attention score is used to perform weighted summation on the corresponding sub-feature maps in the Value sub-feature map set to obtain the self-attention output feature map.

[0070] As an optional implementation method, the intermediate feature set is input into the convolutional attention path layer through the fully connected layer to obtain the convolutional attention output feature map, which specifically includes:

[0071] The intermediate feature set is mapped to a new feature space through parameterized transformation using a fully connected layer to obtain the initial feature atlas.

[0072] Through the convolutional attention path layer, the initial feature map set is shifted and aggregated to obtain the convolutional attention output feature map.

[0073] In another exemplary embodiment of the present application, the calculation method of the wear degree is:

[0074] The contour lines of the worn area in the image are converted into a two-dimensional array, and the sum of the areas enclosed by all pixels in the two-dimensional array is calculated to obtain the area of ​​the worn area in the image.

[0075] The wear ratio is calculated using the following formula, and the degree of wear is determined based on the wear ratio:

[0076]

[0077] Where R represents the wear ratio, S m represents the area of ​​the worn area in the image, S g Represents the area of ​​the entire cable region in the image.

[0078] As an optional implementation manner, determining the degree of wear according to the wear ratio specifically includes:

[0079] If the wear ratio is less than or equal to the first preset wear threshold, it is considered light wear; the light area is represented by blue.

[0080] If the wear ratio is greater than the first preset wear threshold and less than or equal to the second preset wear threshold, it is considered moderate wear; the moderate wear area is represented by yellow.

[0081] If the wear ratio is greater than the second preset wear threshold, it is considered severe wear; the severe wear area is represented by red.

[0082] In another exemplary embodiment of the present application, the training process of the YOLOv8n-seg model is improved, specifically including:

[0083] The images in the steel cable surface wear image dataset are used as input of the improved YOLOv8n-seg model, and the wear area and wear degree in the image are used as output. The improved YOLOv8n-seg model is trained until the difference between the predicted wear area in the image and the corresponding real wear area is less than a first preset threshold, and the difference between the predicted wear degree in the image and the corresponding real wear degree is less than a second preset threshold, and the training is stopped.

[0084] In another exemplary embodiment of the present application, Figure 3 As shown in the figure, a wire rope surface wear detection method based on the improved YOLOv8n-seg model is provided, which consists of the following main steps: data set acquisition, image preprocessing, backbone network feature extraction, neck network feature fusion, detection head target detection and segmentation, result output and post-processing.

[0085] First, images of steel cables were collected using drones. These images were then augmented using techniques such as random flipping, scaling, color adjustment, and noise addition to enrich the dataset and improve the generalization and robustness of the improved model. The augmented steel cable image dataset was then fed into the improved YOLOv8n-seg model. These images were resized to the required input size to accommodate the model's input requirements. The image pixel values ​​were then normalized, typically to the range [0, 1], to improve the stability and convergence speed of the improved model.

[0086] Secondly, the normalized image enters the backbone network for feature extraction. In the backbone network, the AKConv module is introduced to replace the traditional convolution operation. AKConv can adaptively adjust the shape and size of the convolution kernel to more accurately capture the irregular wear characteristics of the steel cable surface. This dynamic adjustment capability enables the improved model to better adapt to wear areas of different shapes and sizes, improving the accuracy and robustness of feature extraction. In the subsequent parts of the backbone network, the feature map is further processed through multiple convolutional layers and pooling layers to gradually extract higher-level features. Before the SPPF layer, a convolutional self-attention mechanism (ACmix) module is added. ACmix combines the advantages of channel attention and spatial attention, and performs a weighted summation of the feature map by processing the self-attention path and the convolution path in parallel. This mechanism not only enhances the improved model's ability to capture key information in complex backgrounds, but also improves its sensitivity to features of different channels and spatial positions, enabling the improved model to more accurately identify the difference between the wear area and the background.

[0087] The feature map then enters the SPPF layer for multi-scale feature fusion. The SPPF layer uses max pooling operations at different scales to capture features at different scales, further enhancing the robustness and richness of the features. At this point, the backbone network completes feature extraction and outputs a feature map, which then enters the neck network for feature fusion. The neck network incorporates a multi-scale convolutional attention (MSCA) module. The MSCA module, through multi-scale convolutional branches and strip-wise convolution operations, further enhances the improved model's ability to recognize strip-like wear features. This design enables the improved model to better handle elongated wear areas, which are common on steel cable surfaces, improving segmentation accuracy and completeness. The neck network combines FPN and PANet, known as the PAN-FPN architecture, to fuse features at different scales and generate a richer feature representation. The fused feature map is then fed into the detection head for object detection and segmentation. The detection head is responsible for the specific tasks of wear object detection and segmentation, predicting the bounding box, category, and corresponding segmentation mask of the worn area. In this process, the detection head utilizes a decoupled head architecture to separate the classification, regression, and segmentation tasks. Ultimately, the test results output by the inspection head enter the result output and post-processing stage. Here, the test results are filtered and integrated using techniques such as non-maximum suppression (NMS), removing duplicate predictions and retaining the most accurate results. These results are then presented to the user in an intuitive manner, with the segmented regions colored on the original image. This provides maintenance personnel with clear and accurate information on wire rope wear, enabling them to take timely and effective maintenance measures.

[0088] In another exemplary embodiment of the present application, the network structure diagram of the improved YOLOv8n-seg model is as follows: Figure 5 As shown in the figure, the improved model replaces standard convolution with AKconv in the backbone network. Using a dynamic kernel generation mechanism, it learns the irregular geometric features of the cable wear region, improving its ability to model slender, curved wear boundaries. Furthermore, an ACmix module is added before the SPPF layer. This module integrates local details with global context through parallel convolution operations and self-attention calculations. A gating mechanism is used to dynamically weight multi-scale features, addressing the original model's segmentation issues with continuous wear regions. The MSCA module is introduced in the neck network, combining deep convolution with multi-scale feature extraction to enhance the model's ability to recognize objects of varying sizes.

[0089] Among them, in this implementation method, AKconv is a dynamic convolution module designed for the irregular wear characteristics of the steel cable surface. Through the adaptive kernel generation mechanism and variable sampling shape, it solves the limitations of traditional convolution kernels in the feature extraction of slender and curved targets. The algorithm uses a coordinate generation strategy to define the initial sampling position for convolution kernels of arbitrary sizes, and introduces a learnable offset to dynamically adjust the sampling shape, so that the convolution kernel can adaptively generate an asymmetric weight distribution according to the geometric characteristics of the input features. Compared with the fixed 3×3 square kernel of the standard convolution, AKconv achieves a balance between computational efficiency and feature representation capabilities by linearly increasing or decreasing the number of parameters, and can effectively capture the curvature change characteristics of slender wear areas in the backbone network. In this way, even if the wear area is irregular in shape or small in size, AKConv can align and extract these features more accurately through its dynamic adjustment capabilities. The structure of AKconv is as follows Figure 6 shown.

[0090] like Figure 6 As shown, the input data is the feature map F of (C, H, W) input , first passes through a regular two-dimensional convolution layer (Conv2d) to generate a position offset (ofset). The output dimension of the offset is (2N, H, W), where N represents the number of sampling points of the convolution kernel. For example, a 3×3 convolution kernel corresponds to N=9, and the coefficient 2 indicates that the offset includes the coordinate adjustment in the x and y directions. The offset is used to adjust the sampling position. Ordinary convolution samples on a fixed regular grid, and after adding the offset, the sampling points can be fine-tuned according to the offset at the original fixed position, so as to better capture geometric changes. For the input feature map F input The position p0, p0 is the convolution kernel in the feature map F input The center position coordinates of the upward slide and the offset of the nth sampling point are calculated as:

[0091] ΔP n =Conv(F input (p0)).

[0092] Then, by adding the offset generated by convolution to the original sampling point, the dynamically adjusted sampling coordinates are obtained, as shown in the following formula:

[0093]

[0094] Where ΔP n Indicates the offset of the nth sampling point, Conv represents the convolution operation, represents the input feature map of the image, Represents a real number matrix, C represents the number of channels of the image, H represents the height of the image, W represents the width of the image, and p0 represents the center position coordinate of the convolution kernel sliding on the input feature map. Indicates the sampling coordinates of the nth sampling point after adjustment, P n Indicates the initial sampling coordinates of the nth sampling point.

[0095] Next, based on the calculated dynamically adjusted sampling coordinates, the input feature map is resampled using bilinear interpolation to extract local feature blocks that are highly compatible with the target morphology. The offset-adjusted sampling shapes and sampling points allow for more flexible capture of local variations in features. After sampling, new feature blocks are formed. These resampled feature blocks are then integrated through channel concatenation to produce a new feature map (C×s, H, W), where s is the number of convolution kernels. This new feature map is then reshaped, reconvolved, and normalized before being output using the SiLU activation function.

[0096] Among them, implementing this implementation, ACmix is ​​a network structure that combines channel mixing and spatial attention. It enhances the model's ability to capture key information by accurately weighting different feature channels and spatial positions. Its structure is as follows Figure 7 shown.

[0097] ACmix consists of two stages. In the first stage, the input features are first projected through three 1×1 convolutional layers. The purpose of this step is to transform the channel dimension of the input features in preparation for the subsequent attention mechanism. The projected features will be reshaped into N blocks. Specifically, if the output of the adaptive kernel convolution module is regarded as a three-dimensional tensor, then the tensor will be rearranged into N smaller sub-feature maps, each of which contains one-third of the input channels. In this way, an intermediate feature set containing 3×N sub-feature maps is obtained. In the second stage, through the parallel processing of the self-attention path layer and the convolution path layer, the three feature maps obtained by projecting through the three 1×1 convolutional layers in the self-attention path are used as the query, key and value respectively. The model generates attention scores by calculating the compatibility of the query with all keys, and then uses these scores to weight and sum the values ​​to obtain the output of the self-attention path layer. For the convolution path, a lightweight fully connected layer is used to process the feature map. For convolution with a kernel size of k, the fully connected layer generates k 2 The feature map is then subjected to a series of shift and aggregation operations. Finally, the outputs of the two paths are weighted and summed. The formula is as follows:

[0098] F out =αF att +βF conv .

[0099] Among them, F out represents the weighted fusion wear feature map, F att Represents the self-attention output feature map of the self-attention path layer, F conv Represents the convolutional attention output feature map of the convolutional attention path layer, and α and β are both constants with value 1.

[0100] Through these two stages, ACmix's attention mechanism comprehensively considers input features across both channel and spatial dimensions. The first stage provides multi-scale feature representations through 1×1 convolution and reshaping as an attention mechanism. In the second stage, parallel processing of self-attention and convolution paths further enriches feature representation, enabling the model to utilize both local convolutional features and global self-attention features. This design enables ACmix to more effectively capture long-range dependencies in images and improves the model's ability to understand complex scenes.

[0101] Among them, in this implementation, MSCA is an advanced attention mechanism that enhances the model's ability to recognize objects of different sizes by combining deep convolution and multi-scale feature extraction. Figure 8As shown in Figure 1, the architecture of MSCA consists of three main components: depthwise convolutional layers, multi-branch depthwise convolutional layers, and 1×1 pointwise convolutional layers. The depthwise convolutional layers are used to aggregate local information. Using 5×5 kernels, these layers extract local features from the input feature map through depthwise convolution operations, providing the foundation for the subsequent multi-scale convolutional attention mechanism. The multi-branch depthwise convolutional layers are used to capture multi-scale contextual information. These layers consist of three groups of convolutional layers processed in parallel: the first group includes two groups of convolutional layers with 1×7 and 7×1 kernels; the second group includes two additional groups of convolutional layers with larger kernels: 1×11 and 11×1; and the third group includes two groups of convolutional layers with the largest kernels: 1×21 and 21×1. Through multi-branch depthwise convolutional operations, MSCA is able to capture contextual information at different scales, enhancing the richness and diversity of feature representation. The 1×1 pointwise convolutional layers model the relationship between different channels in the features and integrate the results of the depthwise convolution operations from the aforementioned multiple branches. This step re-weighs the output of MSCA through 1×1 point-by-point convolution operations, adjusts the feature weights of different channels, and further improves the feature representation capability.

[0102] The design of this module is based on the recognition of the limitations of traditional convolution operations, namely that standard convolution kernels usually only focus on local areas, while MSCA captures broader contextual information by introducing multi-scale convolution branches. These branches use convolution kernels of different sizes to extract features and generate attention weights through 1×1 convolution. These weights are then used to adjust the response of the input features, allowing the model to adaptively focus on key areas in the image. In addition, MSCA also uses strip convolutions (d, 1×7), (d, 7×1), (d, 1×11), (d, 11×1), (d, 1×21) and (d, 21×1), which is a special type of convolution operation used to simulate large-size convolution kernels while maintaining computational efficiency. It can serve as a supplement to grid convolution and help extract strip features. Steel cables and worn areas on the cable surface are both strip features. MSCA can help improve the model's ability to capture features.

[0103] In another exemplary embodiment of the present application, Figure 4 As shown in the figure, a wire rope surface wear detection method based on an improved YOLOv8n-seg model is presented. A high-definition gimbal camera mounted on a drone captures the target wire rope from multiple angles and lighting conditions, acquiring raw image data of the wire rope surface. The drone's flight altitude, shooting angle, and resolution are dynamically adjusted based on the wire rope diameter and ambient lighting conditions to ensure clear images and complete coverage of the wire rope surface.

[0104] Data augmentation processing is performed on the collected cable surface images, including random flipping, scaling, color adjustment, and noise addition, to increase the diversity of the dataset and the generalization ability of the model.

[0105] The network structure of the YOLOv8n-seg model is improved. In the initial layer of the backbone network, AKConv adaptive kernel convolution is used to replace the traditional convolution. The convolution kernel shape and sampling point offset are dynamically adjusted through the adaptive kernel generation mechanism to accurately capture the slender and curved wear boundary features on the steel cable surface. The ACmix convolution self-attention mechanism module is inserted before the SPPF layer, and the feature weighted fusion of the self-attention path and the convolution path is performed in parallel to enhance the model's global context perception ability of the wear area in complex background. The MSCA multi-scale convolution attention module is introduced in the neck network. Through multi-scale convolution branches and strip convolution operations, the recognition ability of the slender wear features on the steel cable surface is enhanced.

[0106] The preprocessed wire rope surface images were divided into training and validation sets according to a preset ratio and fed into the YOLOv8n-seg model for model training. The training set was fed into an improved YOLOv8n-seg model for model parameter optimization. The validation set was used to monitor overfitting during model training and adjust hyperparameters using evaluation metrics. After each round of training, the validation set was used to calculate the mean average precision (mAP), precision (P), and recall (R) of the model. The optimal model weight file was selected and used as the weight file for the wire rope wear detection model. Training was performed under Windows 11, using a 12th Gen Intel(R) Core(TM) i9-12900HX 2.30GHz CPU, an NVIDIA GeForce RTX 4060 Laptop GPU with 8GB of video memory, Pytorch 1.13.1 as the software environment, Python 3.9.19 as the programming language, and CUDA version 11.7. The parameter settings are as follows: the input image size is 640×640, the number of worker threads for data loading is 16, the batch size is 8, the learning rate is 0.01, the number of training rounds is 100, and the rest of the parameters are default parameters.

[0107] The independently collected images of the surface of the steel cable to be inspected are input into the improved model, which can automatically segment the wear area in the image of the surface of the steel cable to be inspected, so that the maintenance personnel can make a preliminary judgment on the wear condition. Figure 9 As shown, Figure 9 (a) is the input image of the steel cable surface to be detected, Figure 9 (b) is the wear image detected by the improved model, and the yellow area is the wear area segmented by the improved model.

[0108] In another embodiment of the present application, when the improved model detects wear and tear, it reads the EXIF ​​information of the corresponding photo containing the wear and tear. Photo EXIF ​​information is metadata embedded in image files that records various detailed information related to the photo. GPS coordinate data is read from the EXIF ​​information and output. This data is stored in the form of longitude and latitude and can be used to determine the specific location when the photo was taken. Based on this location information, maintenance personnel can find the wear and tear more quickly and narrow the search area.

[0109] After the improved model outputs the detected wear, the area of ​​the wear region is calculated for each wear. The area of ​​the wear region is obtained by converting the wear contour into a two-dimensional array and calculating the sum of the areas enclosed by all pixels in the array. A schematic diagram comparing the area of ​​the wear region in the image of the steel cable to be tested and the area of ​​the entire steel cable in the steel wire rope to be tested is shown in the figure below. Figure 10 As shown, the shaded part in the figure represents the area of ​​the wire rope wear area in the overall wire rope area.

[0110] The wear ratio is calculated using the following formula, and the degree of wear is determined based on the wear ratio:

[0111]

[0112] Where R represents the wear ratio, S m represents the area of ​​the worn area in the image, S g Represents the area of ​​the entire cable region in the image.

[0113] When the wear ratio does not exceed 20%, it is considered light wear; between 20% and 30% is considered moderate wear; and more than 30% is considered severe wear. When the wear detected is light wear, it is indicated in blue; when the wear detected is moderate wear, it is indicated in yellow; when the wear detected is severe wear, it is indicated in red, in order to distinguish different degrees of wear, such as Figure 11 shown.

[0114] The wire rope surface wear detection method based on the improved YOLOv8n-seg model in this application is an intelligent detection method that uses deep learning and computer vision technology to automatically analyze and process cableway surface images captured by drones to identify and locate worn areas on the wire rope surface. The core of this method lies in optimizing and improving the YOLOv8n-seg model to better adapt it to the characteristics and requirements of the wire rope surface wear detection task. Object detection and segmentation are key steps in this method, and together they ensure the accurate identification and location of worn areas on the wire rope surface. Object detection is primarily responsible for identifying the location and range of worn areas in the image, which is achieved by predicting bounding boxes and category labels. The improved YOLOv8n-seg model utilizes its powerful feature extraction capabilities and advanced detection algorithms to quickly and accurately detect worn targets in images, maintaining high detection accuracy even in complex backgrounds and lighting conditions. Segmentation, based on object detection, further refines the identification of worn areas, generates accurate segmentation masks, and locates the worn areas in the image.

[0115] Working Principle: When using the improved YOLOv8n-seg-based cable surface wear detection method, a drone equipped with a high-definition camera first inspects the cableway and acquires image data of the cableway surface. This image data is then transmitted to a backend processing system for preprocessing, including image resizing and pixel normalization, to meet the input requirements of the improved YOLOv8n-seg model. Next, the improved YOLOv8n-seg model begins operation. Its advanced backbone network uses depthwise separable convolution and batch normalization techniques to extract rich feature information from the preprocessed image, including key features such as the cableway surface texture, shape, and color. This feature information provides a solid foundation for subsequent object detection and segmentation tasks. During the object detection stage, the improved model uses its optimized detection algorithm to analyze the extracted features and predict the bounding box and class label of the worn area. Even in complex backgrounds and with varying lighting conditions, the improved YOLOv8n-seg model can effectively identify the location and extent of worn objects. The introduction of a multi-scale convolutional attention (MSCA) module further refines the identification of worn areas. The MSCA module captures detailed information about wear characteristics and generates high-quality segmentation masks, accurately separating worn areas from the background and precisely locating them. Finally, based on the detection and segmentation results, the processing system provides maintenance personnel with information about each detected wear area, enabling effective maintenance and management of the cableway.

[0116] The present application also provides an application scenario, which applies the above-mentioned wire rope surface wear detection method based on the improved YOLOv8n-seg model. Specifically: the wire rope surface wear detection method based on the improved YOLOv8n-seg model provided in this embodiment can be applied in industrial equipment maintenance scenarios. This scenario includes a preliminary inspection link, a wire rope surface wear detection link, and a maintenance decision-making link; the wire rope surface image enters the wire rope surface wear detection link from the preliminary inspection link, obtains the wear detection result through analysis based on the improved YOLOv8n-seg model, and enters the maintenance decision-making link. The wire rope surface wear detection method based on the improved YOLOv8n-seg model provided in this embodiment belongs to the wire rope surface wear detection link in the industrial equipment maintenance scenario. Specifically, in the industrial equipment maintenance scenario, the preliminary inspection link is responsible for performing routine inspections on the equipment to identify any obvious signs of faults or damage. Subsequently, if the preliminary inspection indicates that there may be a problem with wire rope wear, or as part of regular maintenance, the process will enter the wire rope surface wear detection link. In this phase, a modified YOLOv8n-seg model is used to perform detailed image analysis of the cable to automatically identify and locate areas of possible wear. After obtaining the wear detection results, the process enters the maintenance decision-making phase, where maintenance personnel assess the condition of the cable based on the test results and determine whether repair or replacement is necessary. By providing accurate and reliable wear detection results, the method in this application provides a scientific basis for maintenance decisions, thereby ensuring the safe and efficient operation of industrial equipment.

[0117] To address the problems of low manual inspection efficiency, strong subjectivity, and susceptibility to environmental interference in existing ropeway surface wear detection methods, this application introduces drone inspections and automated detection technology based on improved YOLOv8n-seg, transforming traditional manual reliance into intelligent processing, significantly improving detection efficiency and objectivity while avoiding interference from environmental factors on detection results. To address the defects of traditional image processing methods that are prone to missed detection or false detection under complex backgrounds and irregular wear features, this application dynamically adjusts the convolution kernel shape and sampling point offset through the AKConv module, breaking through the limitations of the fixed sampling window of standard convolution, adaptively capturing the geometric features of irregular wear such as slenderness and curvature, and effectively reducing the missed detection rate and false detection rate. To address the hardware resource waste caused by the squared growth of standard convolution parameters with the kernel size, AKConv optimizes computational efficiency by linearly increasing and decreasing the number of parameters. This reduces model complexity while maintaining high-precision feature extraction, making it particularly suitable for lightweight deployment scenarios. Furthermore, to address the shortcomings of existing methods combining convolution and self-attention that fail to fully exploit the relationship between the two, the ACmix module performs weighted fusion of features from the self-attention path and the convolution path in parallel, enhancing global context perception while reducing segmentation breaks. The MSCA module, through the synergy of multi-scale convolution branches and strip convolutions, enhances sensitivity to the slender wear features on the cable surface, further balancing computational overhead with feature expression capabilities. These improvements collectively enable precise pixel-level segmentation of cable surface wear, ultimately providing maintenance personnel with highly reliable detection results, significantly improving the safety and maintenance efficiency of cableway facilities while reducing maintenance costs.

[0118] In summary, this application introduces AKconv adaptive kernel convolution into the YOLOv8n-seg model, dynamically adjusts the convolution kernel shape and sampling point offset, and can more accurately capture irregular wear features on the wire rope surface (such as slender, curved boundaries), thereby solving the limitations of traditional convolution in extracting irregular target features. The ACmix convolution attention and MSCA multi-scale attention modules are integrated into the YOLOv8n-seg model. ACmix combines the weighted fusion of features of the self-attention path and the convolution path to enhance the global context perception capability under complex backgrounds and reduce segmentation breaks. MSCA uses multi-scale convolution branches and strip convolutions to enhance the recognition sensitivity to slender wear features on the wire rope surface, balancing computational efficiency and feature extraction capabilities. The network structure of the YOLOv8n-seg model is improved to address the problems of irregular shapes of wire rope wear and inaccurate segmentation of wire rope wear boundaries, achieving more accurate pixel-level segmentation of wire rope surface wear.

[0119] In another embodiment of the present application, some alternatives are provided based on the model architecture perspective. In addition to improving the YOLOv8n-seg model, you can also try to use other instance segmentation models, for example, you can use Mask RC-CNN or U-Net as the basic framework. You can also replace AKConv and ACmix by changing the network structure, or introducing modules similar to dynamic convolution and attention mechanisms, such as deformable convolution Deformable ConvNets, and the self-attention layer in Transformer. Or you can combine multi-scale feature fusion strategies, such as using the ASPP (Atrous Spatial Pyramid Pooling) module to simulate the function of MSCA. From a theoretical perspective, it is also possible to achieve the detection and segmentation effect of wire rope surface wear.

[0120] However, the above alternatives have some shortcomings. Two-stage models such as Mask RC-CNN have relatively slow inference speeds and are difficult to meet the real-time requirements of drone inspections. Although the Transformer architecture can capture global dependencies, its computational complexity is significantly higher than the lightweight YOLOv8n-seg, making it less advantageous for edge device deployment. Although Deformable ConvNets supports dynamic sampling, its parameter adjustment mechanism lacks the linear scalability of AKConv and performs poorly in hardware resource optimization. In addition, among traditional image processing methods, algorithms based on morphological operations or texture analysis, although they do not require deep learning model training, find it difficult to stably extract irregular wear features in the presence of complex background interference, and cannot achieve high segmentation accuracy.

[0121] Although there are many technical routes that can partially solve the problem of wire rope wear detection, it is difficult to achieve balanced optimization with the present application in terms of detection efficiency, hardware adaptability, cost control and robustness in complex scenarios. Therefore, the technical solution of the present application has significant uniqueness in achieving the comprehensive effectiveness of the invention purpose.

[0122] Based on the same inventive concept, embodiments of the present application also provide a device for detecting steel cable surface wear based on an improved YOLOv8n-seg model, which is used to implement the aforementioned method for detecting steel cable surface wear based on an improved YOLOv8n-seg model. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the device for detecting steel cable surface wear based on an improved YOLOv8n-seg model provided below can be found in the aforementioned limitations of the method for detecting steel cable surface wear based on an improved YOLOv8n-seg model, and will not be further elaborated here.

[0123] In an exemplary embodiment, Figure 12 As shown, a wire rope surface wear detection device based on an improved YOLOv8n-seg model is provided, including:

[0124] The image acquisition and annotation module 301 is used to acquire an image of the surface of the steel cable and annotate the actual wear area and the actual wear degree in the image.

[0125] The data set construction module 302 is used to perform data enhancement on the image and form a wire rope surface wear image data set together with the annotated real wear area and real wear degree in the image.

[0126] The model improvement and construction module 303 is used to replace the traditional convolution module in the YOLOv8n-seg model backbone network with an adaptive kernel convolution module, insert a convolutional self-attention mechanism module before the fast spatial pyramid pooling module in the backbone network; introduce a multi-scale convolutional attention module in the neck network to construct an improved YOLOv8n-seg model.

[0127] The model training module 304 is used to train the improved YOLOv8n-seg model using the wire rope surface wear image dataset to obtain a trained improved YOLOv8n-seg model.

[0128] The wear prediction module 305 is used to input the image of the surface of the steel cable to be detected into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be detected.

[0129] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store processing data of the steel cable to be detected. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a steel cable surface wear detection method based on an improved YOLOv8n-seg model is implemented.

[0130] Those skilled in the art will understand that Figure 13 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.

[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0132] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0133] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0134] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0135] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A wire rope surface wear detection method based on an improved YOLOv8n-seg model, characterized in that: The wire rope surface wear detection method based on the improved YOLOv8n-seg model includes: Collecting an image of the steel cable surface and marking the actual wear area and the actual wear degree in the image; Performing data enhancement on the image, and forming a steel cable surface wear image dataset together with the annotated real wear area and real wear degree in the image; The adaptive kernel convolution module replaces the traditional convolution module in the YOLOv8n-seg model backbone network, and the convolutional self-attention mechanism module is inserted before the fast spatial pyramid pooling module in the backbone network. The multi-scale convolutional attention module is introduced in the neck network to construct an improved YOLOv8n-seg model. The improved YOLOv8n-seg model is trained using the steel cable surface wear image dataset to obtain a trained improved YOLOv8n-seg model; The image of the surface of the steel cable to be inspected is input into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected.

2. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 1 is characterized in that: Performing data enhancement on the image, specifically including: Data augmentation is performed on the images by randomly flipping, scaling, color adjustment, and noise addition.

3. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 1 is characterized in that: The adaptive kernel convolution module specifically includes: a two-dimensional convolution layer, a resampling layer, a reshaping layer, a one-dimensional convolution layer, a normalization layer and an activation function layer connected in sequence; The two-dimensional convolutional layer is used to generate an offset using the following formula and dynamically adjust the sampling coordinates based on the offset: ΔP n =Conv(F input (p0)); Where ΔP n Indicates the offset of the nth sampling point, Conv represents the convolution operation, represents the input feature map of the image, Represents a real number matrix, C represents the number of channels of the image, H represents the height of the image, W represents the width of the image, and p0 represents the center position coordinate of the convolution kernel sliding on the input feature map. Indicates the sampling coordinates of the nth sampling point after adjustment, P n Indicates the initial sampling coordinates of the nth sampling point; The resampling layer is used to resample the input feature map using bilinear interpolation according to the adjusted sampling coordinates, extract local feature blocks of different scales, shapes and positions on the surface of the steel cable; and integrate all the extracted local feature blocks through channel splicing to obtain an integrated feature map; The integrated feature map is reshaped by the reshaping layer, re-convolved by the one-dimensional convolution layer, and standardized by the standardization layer, and then input into the activation function layer to obtain an adaptive wear feature map.

4. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 1 is characterized in that: The convolutional self-attention mechanism module specifically includes: three 1×1 convolutional layers, a fully connected layer, a convolutional attention path layer, a self-attention path layer, two connection layers and a residual connection layer; The adaptive wear feature map is projected through three 1×1 convolutional layers to obtain multi-scale features; Reshape the multi-scale features into N blocks to form an intermediate feature set containing 3×N sub-feature maps; each sub-feature map contains one-third of the number of channels of the adaptive wear feature map; The intermediate feature set is input into the convolutional attention path layer through the fully connected layer, and the intermediate feature set is directly input into the self-attention path layer to obtain the convolutional attention output feature map and the self-attention output feature map respectively; The convolutional attention output feature map and the self-attention output feature map are respectively input into the residual connection layer after passing through a connection layer. The residual connection layer is used to perform a weighted summation of the convolutional attention output feature map and the self-attention output feature map using the following formula to obtain a weighted fusion wear feature map: F out =αF att +βF conv ; Among them, F out represents the weighted fusion wear feature map, F att Represents the self-attention output feature map, F conv represents the convolutional attention output feature map, α and β are the first and second constants respectively.

5. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 4 is characterized in that: The intermediate feature set is directly input into the self-attention path layer to obtain the self-attention output feature map, which specifically includes: Through the self-attention path layer, the sub-feature maps of the three 1×1 convolutional layers in the intermediate feature set are divided into a query sub-feature map set, a key sub-feature map set, and a value sub-feature map set; Traverse the query sub-feature map set, calculate the dot product similarity between each pixel of the current sub-feature map and all pixels of the corresponding sub-feature map in the key sub-feature map set, and generate an attention score; The attention score is used to perform weighted summation on the corresponding sub-feature maps in the Value sub-feature map set to obtain the self-attention output feature map.

6. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 4 is characterized in that: The intermediate feature set is input into the convolutional attention path layer through the fully connected layer to obtain the convolutional attention output feature map, which specifically includes: Use the fully connected layer to map the intermediate feature set to a new feature space through parameterized transformation to obtain the initial feature atlas; Through the convolutional attention path layer, the initial feature map set is shifted and aggregated to obtain the convolutional attention output feature map.

7. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 1 is characterized in that: The calculation method of wear degree is: Convert the contour line of the worn area in the image into a two-dimensional array, and calculate the sum of the areas enclosed by all pixels in the two-dimensional array to obtain the area of ​​the worn area in the image; The wear ratio is calculated using the following formula, and the degree of wear is determined based on the wear ratio: Where R represents the wear ratio, S m represents the area of ​​the worn area in the image, S g Represents the area of ​​the entire cable region in the image.

8. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 7 is characterized in that: Determine the degree of wear based on the wear ratio, including: If the wear ratio is less than or equal to the first preset wear threshold, it is considered light wear; the light area is represented by blue; If the wear ratio is greater than the first preset wear threshold and less than or equal to the second preset wear threshold, it is considered moderate wear; the moderate wear area is indicated in yellow; If the wear ratio is greater than the second preset wear threshold, it is considered severe wear; the severe wear area is represented by red.

9. The wire rope surface wear detection method based on the improved YOLOv8n-seg model according to claim 1 is characterized in that: Improve the training process of the YOLOv8n-seg model, including: The images in the steel cable surface wear image dataset are used as input of the improved YOLOv8n-seg model, and the wear area and wear degree in the image are used as output. The improved YOLOv8n-seg model is trained until the difference between the predicted wear area in the image and the corresponding real wear area is less than a first preset threshold, and the difference between the predicted wear degree in the image and the corresponding real wear degree is less than a second preset threshold, and the training is stopped.

10. A wire rope surface wear detection device based on an improved YOLOv8n-seg model, characterized in that: The wire rope surface wear detection device based on the improved YOLOv8n-seg model includes: An image acquisition and annotation module, for acquiring images of the surface of the steel cable and annotating the actual wear area and the actual wear degree in the images; a data set construction module, configured to perform data enhancement on the image and construct a steel cable surface wear image data set together with the annotated real wear areas and real wear degrees in the image; A model improvement and construction module, which replaces the traditional convolution module in the YOLOv8n-seg model backbone network with an adaptive kernel convolution module and inserts a convolutional self-attention mechanism module before the fast spatial pyramid pooling module in the backbone network; introduces a multi-scale convolutional attention module in the neck network to build an improved YOLOv8n-seg model; The model training module is used to train the improved YOLOv8n-seg model using the steel cable surface wear image dataset to obtain a trained improved YOLOv8n-seg model; The wear prediction module is used to input the image of the surface of the steel cable to be inspected into the trained improved YOLOv8n-seg model to obtain the predicted wear area and predicted wear degree of the surface of the steel cable to be inspected.

Citation Information

Cited By

  • Wear type quantitative identification method based on image segmentation

    CN121904382A

  • A quantitative identification method of wear type based on image segmentation

    CN121904382B

  • Model training method, crack detection method, computing device, and readable storage medium

    CN122510258A