Real-time detection method, device and equipment for service state of pipeline fastening equipment and storage medium

By improving the YOLOv11 architecture and data augmentation technology, the problems of model deployment and accuracy in the inspection of gas pipeline fastening equipment have been solved, enabling real-time, high-precision inspection on mobile devices, reducing hardware costs and the rate of missed detections.

CN122073008APending Publication Date: 2026-05-22TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN UNIVERSITY OF TECHNOLOGY
Filing Date
2026-02-09
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

The existing target detection model YOLO has problems with model deployment and resource consumption, insufficient accuracy and environmental adaptability in the service status detection of gas pipeline fastening equipment. It cannot effectively identify minor defects and dynamic status changes, and real-time data feedback is limited in places without power.

Method used

By adopting an improved YOLOv11 architecture, introducing the cross-stage local bottleneck module C3k2 and the parallel spatial attention module C2PSA, and combining a hybrid convolutional block attention mechanism and a decoupling head, multi-angle images are acquired through drones or pipeline inspection robots, and data augmentation and feature map weight allocation are performed to achieve real-time detection.

Benefits of technology

It improves detection accuracy and adaptability, reduces hardware requirements and deployment costs, supports real-time monitoring of the service status of gas pipeline fastening equipment in mobile devices, and reduces the risk of leakage caused by fastening equipment failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122073008A_ABST
    Figure CN122073008A_ABST
Patent Text Reader

Abstract

The invention provides a real-time detection method, device and equipment for the service state of pipeline fastening equipment and a storage medium, and relates to the technical field of target detection. The method comprises the following steps: acquiring a multi-angle real-time state image, and constructing a training data set after size adjustment, data enhancement and labeling; an improved YOLOv11 detection model is constructed, C3k2 and C2PSA modules are introduced into a backbone network of the improved YOLOv11 detection model, and a CBAM attention mechanism is fused in a neck network; carrying out multi-task output by adopting a decoupling head, and respectively returning a position and a classification state; training and optimizing the model by using an automatic mixing precision training mode in combination with an optimizer and a cosine annealing scheduler; and inputting a real-time video frame into the trained model, and outputting a detection result with confidence to realize real-time monitoring and early warning of the service state. The method improves the detection precision and real-time performance of small target fastening equipment in a complex environment, can be deployed on mobile equipment, and is suitable for pipeline safety online monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of target detection technology, and in particular to a method, apparatus, equipment and storage medium for real-time detection of the service status of pipeline fastening equipment. Background Technology

[0002] In natural gas pipeline systems, fasteners at connections play a crucial role in the system's operational stability and sealing design. According to reports, accidents caused by operational issues in global gas pipeline facilities each year have serious consequences, often stemming from gas leaks and explosions due to the failure of fasteners at connections. Therefore, effective inspection of gas pipeline fasteners is essential to ensuring the safety and reliability of gas storage and transportation systems. Traditional inspection methods rely primarily on manual inspections or periodic maintenance. These methods are not only subjective but also inefficient and pose high safety risks, especially in large outdoor environments where manual inspection has many drawbacks. Alternatively, vibration sensors or strain gauges can be installed at pipeline connections to provide continuous inspection results, but these methods are costly to deploy and require significant modifications to existing gas pipeline systems. Furthermore, current methods struggle to cover all scenarios and fastener types. With increased computing power, computer vision technology has become a mainstream solution in industrial production inspection. Previously, edge detection algorithms were commonly used to identify components and their defects, but their accuracy in identifying background noise and deformed components is low, limiting their widespread application. With the development of deep learning, convolutional neural networks have achieved significantly higher accuracy in fault identification; however, the need for timely detection results still faces significant challenges. In recent years, the object detection model YOLO has gained widespread attention due to its high detection speed and accuracy. By improving the backbone and neck architecture, YOLOv11's feature extraction capabilities have been enhanced. Combined with a custom pipeline component status dataset and real-time optimization algorithms, higher accuracy in service condition detection has been achieved. However, the existing object detection model YOLO still has the following shortcomings when detecting the service condition of pipeline fastening equipment: Model deployment and resource consumption limitations: Early versions of YOLO had large model sizes, resulting in high power consumption and insufficient operational stability when deployed on mobile devices. Furthermore, previous models were often adapted to static graphs, leading to long inference times in real-time detection. Therefore, the need for real-time data feedback in locations without power was severely limited.

[0003] Insufficient accuracy and environmental adaptability: Gas pipeline fastening components are often small in size and easily obscured, and the background in the field is complex. Existing detection methods have a low recognition rate for minute defects, resulting in a high rate of missed detections and an inability to effectively detect dynamic changes in the service components.

[0004] This application aims to fill the gap in the existing technology and provide an industrial application solution for real-time, high-precision monitoring of the service status of gas pipeline fasteners. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for real-time detection of the service status of pipeline fastening equipment. Driven by an improved backbone and neck architecture model and a dedicated dataset, a method for detecting the service status of gas pipeline fastening devices is developed, improving real-time detection speed and accuracy. It supports deployment on mobile devices, enabling real-time detection of the service status of pipeline fastening equipment from dynamic video streams, thereby reducing the risk of pipeline accidents.

[0006] In a first aspect, this application provides a method for real-time detection of the service status of pipeline fastening equipment, including: Acquire multi-angle real-time status images; wherein, the multi-angle real-time status images are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route; The multi-angle real-time status images are decomposed into static images frame by frame, the image size is uniformly adjusted, and data augmentation processing is performed, including random reversal, adding noise, and adjusting brightness. Then, the images are normalized, and the bounding boxes and status categories of the fastening devices in the images are labeled using annotation tools to obtain the preprocessed dataset. The status categories include fastening and loosening. The YOLOv11 architecture is adopted, and cross-stage local bottleneck module C3k2 and cross-stage local module C2PSA with parallel spatial attention are introduced into its backbone network. A hybrid convolutional block attention mechanism is introduced into the neck network of YOLOv11. The feature map is weighted by channel attention and spatial attention to suppress background noise and improve the localization accuracy of device position. The target detection task is decomposed into parallel bounding box regression subtask and state classification subtask by a decoupling head, which are used to predict the location and service status of fastening equipment, respectively. Based on the preprocessed dataset, the constructed YOLOv11 detection model is trained; the training is based on the PyTorch framework and adopts the automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces a cross-stage local bottleneck module C3k2 and a cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces a hybrid convolutional block attention mechanism, and a decoupling head. The model parameters were optimized using an optimizer and a cosine annealing scheduler. The preprocessed video frames are input into the trained model for frame-by-frame detection and inference. The output includes bounding box positions, component categories, state labels, and confidence scores. State monitoring and early warning are performed based on changes in the confidence scores.

[0007] In one possible design, the multi-angle real-time status images cover different environmental conditions, device appearance, and acquisition distance.

[0008] In one possible design, the acquired images include front and side views, environmental conditions include lighting and shadows, device appearance includes clean and dirty surfaces, and acquisition distances include long and short distances.

[0009] In one possible design, the cross-stage local bottleneck module C3k2 is implemented using 3×3 convolution stacks, and its structure is represented as follows: in, This represents the final output fused feature map. This indicates a channel concatenation operation, which merges the unprocessed original features with the convolutionally processed features. This represents a bottleneck layer chain composed of multiple C3k modules. Indicates the original, unprocessed features. This represents the features that have undergone convolution processing.

[0010] In one possible design, the channel attention mechanism generates channel weights through global average pooling and global max pooling, calculated using the following formula: in, This represents channel attention mapping. This represents the Sigmoid activation function. This represents the weights used to recover the channel dimension. This represents the weights used to compress the channel. Indicates global average pooling. Indicates global max pooling; The spatial attention mechanism generates a spatial weight mask through cross-channel pooling operations, calculated using the following formula: in, Represents spatial attention mapping, Indicates the kernel size. This indicates average pooling performed along the channel axis. Indicates input features, This indicates the maximum pooling performed along the channel axis.

[0011] In one possible design, the automatic mixed-precision training is achieved through loss scaling, with the scaling formula being: in, This represents the adjusted loss gradient. Indicates the scaling factor. This represents the original total loss gradient.

[0012] In one possible design, state monitoring and early warning are performed based on changes in confidence scores, including: When the output state confidence score is lower or higher than the preset threshold, an alarm is triggered and the frame information is recorded.

[0013] Secondly, this application provides a real-time monitoring device for the service status of pipeline fastening equipment, the device comprising: The data acquisition module is configured to acquire multi-angle real-time status images; wherein, the multi-angle real-time status images are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route; The data preprocessing module is configured to decompose the multi-angle real-time state image frame by frame into static images, uniformly adjust the image size, and perform data enhancement processing, including random reversal, adding noise, and adjusting brightness. Subsequently, the image is normalized, and the bounding boxes and state categories of the fastening devices in the image are labeled using a labeling tool to obtain the preprocessed dataset. The state categories include fastening and loosening. The model building module is configured to adopt the YOLOv11 architecture, introducing the cross-stage local bottleneck module C3k2 and the cross-stage local module C2PSA with parallel spatial attention into its backbone network; The attention mechanism module is configured to introduce a hybrid convolutional block attention mechanism in the neck network of YOLOv11, which assigns weights to feature maps through channel attention and spatial attention mechanisms to suppress background noise and improve the accuracy of device location. The task output module is configured to use a decoupling head to decompose the target detection task into parallel bounding box regression subtasks and state classification subtasks, which are used to predict the location and service status of the fastening equipment, respectively. The training strategy optimization module is configured to train the constructed YOLOv11 detection model based on the preprocessed dataset; the training is based on the PyTorch framework and adopts an automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces a cross-stage local bottleneck module C3k2 and a cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces a hybrid convolutional block attention mechanism, and a decoupling head; The hyperparameter optimization module is configured to optimize model parameters using an optimizer and a cosine annealing scheduler. The status output module is configured to input preprocessed video frames into the trained model for frame-by-frame detection and inference, and output results including bounding box positions, component categories, status labels, and confidence scores. Status monitoring and early warning are performed based on changes in the confidence scores.

[0014] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the real-time detection method for the service status of pipe fastening equipment as described in the first aspect and various possible designs of the first aspect.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the real-time detection method for the service status of pipeline fastening equipment as described in the first aspect and various possible designs of the first aspect.

[0016] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the real-time detection method for the service status of pipeline fastening equipment as described in the first aspect and various possible designs of the first aspect.

[0017] The method, apparatus, equipment, and storage medium for real-time monitoring of the service status of pipeline fastening equipment provided in this application have at least the following beneficial effects: Addressing the issues of traditional manual inspections or sensor-based methods requiring downtime and complex installation, this application offers a vision-based non-contact solution that eliminates the need for pipeline modifications. It supports online monitoring with low hardware requirements, reducing deployment costs. Simultaneously, it improves detection coverage and timeliness, reducing leakage and pollution caused by fastening equipment failure. YOLOv11 achieves higher detection accuracy with fewer parameters. In pipeline fastening component inspection, the C3k2 module and CBAM attention mechanism introduced by YOLOv11 improve the recognition rate of small devices, thereby enhancing feature extraction efficiency and adaptability to complex scenarios. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] Figure 1 The flowchart of a real-time detection method for the service status of pipeline fastening equipment provided in this application embodiment Figure 1 ; Figure 2 The flowchart of a real-time detection method for the service status of pipeline fastening equipment provided in this application embodiment Figure 2 ; Figure 3 The model prediction results and performance evaluation diagrams provided in the embodiments of this application; Figure 4 This is a structural diagram of the real-time monitoring device for the service status of pipeline fastening equipment provided in an embodiment of this application.

[0020] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0022] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0023] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0024] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0025] This application provides a method for real-time detection of the service status of pipeline fastening equipment, such as... Figure 1As shown, this method takes the pipeline equipment acquisition terminal as the starting point for data acquisition. First, the relevant data of the pipeline fastening equipment is acquired through S1, and then the image is preprocessed through S2. Subsequently, the data flows into the core processing module composed of the backbone network and the neck network. The model is constructed through S3 and combined with the CBAM attention mechanism introduced in S4 to realize the feature channel weight allocation and target position enhancement respectively. Then, the detection head performs bounding box regression / localization and multi-task state classification in S5. After training and output optimization in S6 / S7, the final detection analysis is completed through S8, and the final output is the detection result of the equipment service status as "fastened" or "loose".

[0026] Specifically, this method includes data acquisition and preprocessing, constructing a YOLOv11 detection model, multi-state classification, real-time inference, and post-processing result output. In this embodiment, the methods work together to achieve and improve the real-time performance and accuracy of pipeline fastening equipment detection, ensuring stable system operation. Figure 2 As shown, the detailed content, operation process, process conditions and their effects of this method are as follows: steps S1-S8.

[0027] S1: Acquire real-time status images from multiple angles; wherein, the real-time status images from multiple angles are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route.

[0028] In this embodiment, the multi-angle real-time status images acquired in step S1 can be obtained by using a drone equipped with a high-resolution camera or a pipeline inspection robot equipped with a high-resolution camera to collect real-time status images of the fastening equipment at the connection points along the gas pipeline route. The collected images are required to include multiple angles of the fastening equipment, namely front and side views; environmental conditions include both lit and shadowed conditions; equipment appearance includes various types such as clean and dirty surfaces; acquisition distances include both long and short distances; and image types include fastened nuts, loose nuts, fastened nuts, and loose nuts. The purpose of step S1 is to ensure the diversity of the learning data.

[0029] S2: Decompose the real-time status images from multiple angles frame by frame into static images, uniformly adjust the image size, and perform data augmentation processing, including random reversal, adding noise, and adjusting brightness. Then, normalize the images and use annotation tools to annotate the bounding boxes and status categories of the fastening devices in the images to obtain the preprocessed dataset. The status categories include fastening and loosening.

[0030] For example, the acquired video file is decomposed frame by frame into static images, and the image size is adjusted to 640×640 pixels. The image angle is adjusted by random reversal, noise is added to the image, and the brightness of the image is randomly adjusted. The adjusted dedicated dataset is then normalized. This step aims to optimize the distribution of training data, improve the model's generalization ability to identify pipeline service status in real-world environments, reduce the risk of overfitting, and ensure that the preprocessed data is input into the model for training in a standard format. The LabelImg tool is used to label the bounding boxes and state categories as "secure" and "loose."

[0031] S3: Adopts the YOLOv11 architecture, and introduces the cross-stage local bottleneck module C3k2 and the cross-stage local module C2PSA with parallel spatial attention into its backbone network.

[0032] This embodiment adopts the YOLOv11 architecture and enhances the model's feature capture capability in complex contexts by introducing cross-stage local bottlenecks (C3k2) with two convolutional kernel selections and cross-stage local modules (C2PSA) with parallel spatial attention.

[0033] In some embodiments, C3k2 employs a stack of 3×3 convolutions, which can achieve an equivalent detection field of view with a smaller number of parameters, as shown below: in, This represents the final output fused feature map. This indicates a channel concatenation operation, which merges the unprocessed original features with the convolutionally processed features. This represents a bottleneck layer chain composed of multiple C3k modules. Indicates the original, unprocessed features. This represents the features that have undergone convolution processing.

[0034] Its backbone network is capable of identifying and extracting features of equipment displacement changes from real-time images, thereby securing the physical position of the equipment. The C3k2-structured backbone network improves the mean average accuracy (mAP) by approximately 20% compared to traditional structures. To handle the impact of shadow changes on the securing equipment, the input feature map is divided along the channel dimension: one part is used for computation, and the other part is directly merged with the computation result, thus ensuring the model's accurate recognition of shadow effects. Because the service status of the pipeline securing equipment changes only slightly in a panoramic environment...

[0035] S4: A hybrid convolutional block attention mechanism is introduced into the neck network of YOLOv11. The feature map is weighted by channel attention and spatial attention mechanisms to suppress background noise and improve the localization accuracy of the device position.

[0036] This embodiment introduces a hybrid convolutional block attention mechanism (CBAM) in the neck network, which assigns weights to the feature maps in both channel and spatial dimensions.

[0037] In some embodiments, the channel attention mechanism performs global average pooling and global max pooling: in, This represents channel attention mapping. This represents the Sigmoid activation function. This represents the weights used to recover the channel dimension. This represents the weights used to compress the channel. Indicates global average pooling. This indicates global max pooling.

[0038] Channel attention mechanisms can effectively reduce background noise interference and lower the false negative rate.

[0039] The spatial attention mechanism generates a two-dimensional spatial mask by extracting maxima and minima across channels: in, Represents spatial attention mapping, Indicates the kernel size. This indicates average pooling performed along the channel axis. Indicates input features, This indicates the maximum pooling performed along the channel axis.

[0040] This process enables the network to accurately pinpoint the location of devices, improving the model's ability to detect subtle movements.

[0041] S5: The target detection task is decomposed into parallel bounding box regression subtask and state classification subtask using a decoupling head, which are used to predict the location and service status of fastening equipment, respectively.

[0042] This embodiment uses a decoupling head to split the tasks of target classification and bounding box regression into parallel sub-paths, allowing the model to independently optimize its respective loss function. Specifically, the regression task predicts the location of the fastening device, while the classification task predicts the current service status of the device.

[0043] S6: Based on the preprocessed dataset, train the constructed YOLOv11 detection model; the training is based on the PyTorch framework and adopts the automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces the cross-stage local bottleneck module C3k2 and the cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces the hybrid convolutional block attention mechanism, and a decoupling head.

[0044] In some embodiments, an Automatic Mixed Precision (AMP) training mode is used based on the PyTorch deep learning framework. This is achieved through loss scaling. in, This represents the adjusted loss gradient. Indicates the scaling factor. This represents the original total loss gradient.

[0045] This training mode not only reduces memory usage but also significantly shortens the training iteration cycle.

[0046] S7: The model parameters are optimized using an optimizer and a cosine annealing scheduler; In this embodiment, the AdamW optimizer and Cosine Annealing scheduler are used, with 50-100 training rounds. Through supervised learning, the model learns the image features and state differences of the pipe fastening equipment, thus optimizing the model's feature capture capability.

[0047] S8: Input the preprocessed video frames into the trained model for frame-by-frame detection and inference, and output the results including bounding box positions, component categories, state labels and confidence scores. Perform state monitoring and early warning based on changes in confidence scores.

[0048] In this embodiment, the preprocessed video frames are input frame by frame into the trained model for detection and inference. The output includes a visualization of the bounding box position, component category, state label and confidence score. Progressive state monitoring is performed through the confidence score. When the confidence score drops or rises to the expected threshold, an early warning is triggered and recorded, awaiting manual intervention for maintenance.

[0049] Based on the real-time monitoring process for the service status of pipeline fastening equipment described in S1 to S8 of this application, after conducting actual testing on the fastening equipment at a certain gas pipeline connection, the model prediction results and performance evaluation are as follows: Figure 3 As shown. Figure 3The image presented is the timestamp "huttiahi.iht8:39" corresponding to the detected image. This image is a pipeline fastening device image processed by S1 and S2. The model, through the YOLOv11 architecture built in S3, the CBAM attention mechanism fused in S4, and the multi-task output design in S5, performs detection and inference on the pipeline fastening components in the image, outputting the state labels and corresponding confidence scores of four targets. Specifically, this includes three components labeled "nut_tight" (fastened state), with confidence scores of 0.68, 0.52, and 0.55 respectively, and one component labeled "nut_loose" (loose state). The confidence score is 0.75. The above results fully meet the requirements of S8 post-processing and status assessment output, including core information such as component category, status label and confidence score. Subsequent progressive status monitoring can be carried out based on this confidence score. For example, if the confidence score of "nut_loose" reaches the preset loosening warning threshold of 0.75, an warning can be triggered and recorded, waiting for manual intervention and maintenance. It also verifies the effective ability of the model in this application to distinguish between tight and loose states in actual detection, and reflects the detection accuracy brought by the training and optimization of the S6-S7 model. It further proves that the technical solution of this application can meet the industrial needs of real-time and accurate detection of the service status of pipeline fastening equipment.

[0050] This application also provides a real-time monitoring device for the service status of pipeline fastening equipment, used to implement the methods described in any of the above embodiments, such as... Figure 4 As shown, the real-time monitoring device for the service status of the pipeline fastening equipment includes: The data acquisition module 401 is configured to acquire multi-angle real-time status images; wherein, the multi-angle real-time status images are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route; The data preprocessing module 402 is configured to decompose the multi-angle real-time state image frame by frame into static images, uniformly adjust the image size, and perform data enhancement processing, including random reversal, adding noise, and adjusting brightness. Subsequently, the image is normalized, and the bounding boxes and state categories of the fastening devices in the image are labeled using a labeling tool to obtain the preprocessed dataset. The state categories include fastening and loosening. Model building module 403 is configured to adopt the YOLOv11 architecture, introducing cross-stage local bottleneck module C3k2 and cross-stage local module C2PSA with parallel spatial attention into its backbone network; Attention mechanism module 404 is configured to introduce a hybrid convolutional block attention mechanism in the neck network of YOLOv11, which assigns weights to feature maps through channel attention mechanism and spatial attention mechanism to suppress background noise and improve the localization accuracy of device position. The task output module 405 is configured to use a decoupling head to decompose the target detection task into parallel bounding box regression subtasks and state classification subtasks, which are used to predict the location and service status of the fastening equipment, respectively. The training strategy optimization module 406 is configured to train the constructed YOLOv11 detection model based on the preprocessed dataset; the training is based on the PyTorch framework and adopts an automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces a cross-stage local bottleneck module C3k2 and a cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces a hybrid convolutional block attention mechanism, and a decoupling head; The hyperparameter optimization module 407 is configured to optimize the model parameters using an optimizer and a cosine annealing scheduler. The status output module 408 is configured to input the preprocessed video frames into the trained model for frame-by-frame detection and inference, and output results including bounding box positions, component categories, status labels and confidence scores, and perform status monitoring and early warning based on changes in the confidence scores.

[0051] This application provides an electronic device. The electronic device may include a processor and a memory, wherein the processor and the memory can communicate; exemplarily, the processor and the memory communicate via a communication bus.

[0052] The processor executes computer execution instructions stored in memory, causing the processor to perform the scheme in the above embodiments. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0053] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0054] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0055] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the real-time detection method for the service status of pipeline fastening equipment described in the above embodiment.

[0056] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the real-time detection method for the service status of pipeline fastening equipment in the above embodiments.

[0057] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0058] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0059] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0060] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0061] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0062] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0063] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.

[0064] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0065] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0066] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for real-time detection of the service status of pipeline fastening equipment, characterized in that, The method includes: Acquire multi-angle real-time status images; wherein, the multi-angle real-time status images are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route; The multi-angle real-time status images are decomposed into static images frame by frame, the image size is uniformly adjusted, and data augmentation processing is performed, including random reversal, adding noise, and adjusting brightness. Then, the images are normalized, and the bounding boxes and status categories of the fastening devices in the images are labeled using annotation tools to obtain the preprocessed dataset. The status categories include fastening and loosening. The YOLOv11 architecture is adopted, and cross-stage local bottleneck module C3k2 and cross-stage local module C2PSA with parallel spatial attention are introduced into its backbone network. A hybrid convolutional block attention mechanism is introduced into the neck network of YOLOv11. The feature map is weighted by channel attention and spatial attention to suppress background noise and improve the localization accuracy of device position. The target detection task is decomposed into parallel bounding box regression subtask and state classification subtask by a decoupling head, which are used to predict the location and service status of fastening equipment, respectively. Based on the preprocessed dataset, the constructed YOLOv11 detection model is trained; the training is based on the PyTorch framework and adopts the automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces a cross-stage local bottleneck module C3k2 and a cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces a hybrid convolutional block attention mechanism, and a decoupling head. The model parameters were optimized using an optimizer and a cosine annealing scheduler. The preprocessed video frames are input into the trained model for frame-by-frame detection and inference. The output includes bounding box positions, component categories, state labels, and confidence scores. State monitoring and early warning are performed based on changes in the confidence scores.

2. The method for real-time detection of the service status of pipeline fastening equipment according to claim 1, characterized in that, The multi-angle real-time status images cover different environmental conditions, equipment appearance, and acquisition distance.

3. The method for real-time detection of the service status of pipeline fastening equipment according to claim 2, characterized in that, The acquired images include front and side views, environmental conditions include lighting and shadows, equipment appearance includes surface cleanliness and surface dirt, and acquisition distances include long distance and short distance.

4. The method for real-time detection of the service status of pipeline fastening equipment according to claim 1, characterized in that, The cross-stage local bottleneck module C3k2 is implemented using 3×3 convolution stacking, and its structure is represented as follows: in, This represents the final output fused feature map. This indicates a channel concatenation operation, which merges the unprocessed original features with the convolutionally processed features. This represents a bottleneck layer chain composed of multiple C3k modules. Indicates the original, unprocessed features. This represents the features that have undergone convolution processing.

5. The method for real-time detection of the service status of pipeline fastening equipment according to claim 1, characterized in that, The channel attention mechanism generates channel weights through global average pooling and global max pooling, calculated using the formula: XQ in, This represents channel attention mapping. This represents the Sigmoid activation function. This represents the weights used to recover the channel dimension. This represents the weights used to compress the channel. Indicates global average pooling. Indicates global max pooling; The spatial attention mechanism generates a spatial weight mask through cross-channel pooling operations, calculated using the following formula: in, Represents spatial attention mapping, Indicates the kernel size. This represents the average pooling performed along the channel axis. Indicates input features, This indicates the maximum pooling performed along the channel axis.

6. The method for real-time detection of the service status of pipeline fastening equipment according to claim 1, characterized in that, The automatic mixed-precision training is achieved through loss scaling, and the scaling formula is as follows: in, This represents the adjusted loss gradient. Indicates the scaling factor. This represents the original total loss gradient.

7. The method for real-time detection of the service status of pipeline fastening equipment according to claim 1, characterized in that, Status monitoring and early warning are based on changes in confidence scores, including: When the output state confidence score is lower or higher than the preset threshold, an alarm is triggered and the frame information is recorded.

8. A real-time monitoring device for the service status of pipeline fastening equipment, characterized in that, The device includes: The data acquisition module is configured to acquire multi-angle real-time status images; wherein, the multi-angle real-time status images are acquired by using a drone or pipeline inspection robot equipped with a high-resolution camera to collect images of fastening equipment at connection points along the pipeline route; The data preprocessing module is configured to decompose the multi-angle real-time state image frame by frame into static images, uniformly adjust the image size, and perform data enhancement processing, including random reversal, adding noise, and adjusting brightness. Subsequently, the image is normalized, and the bounding boxes and state categories of the fastening devices in the image are labeled using a labeling tool to obtain the preprocessed dataset. The state categories include fastening and loosening. The model building module is configured to adopt the YOLOv11 architecture, introducing the cross-stage local bottleneck module C3k2 and the cross-stage local module C2PSA with parallel spatial attention into its backbone network; The attention mechanism module is configured to introduce a hybrid convolutional block attention mechanism in the neck network of YOLOv11, which assigns weights to feature maps through channel attention and spatial attention mechanisms to suppress background noise and improve the accuracy of device location. The task output module is configured to use a decoupling head to decompose the target detection task into parallel bounding box regression subtasks and state classification subtasks, which are used to predict the location and service status of the fastening equipment, respectively. The training strategy optimization module is configured to train the constructed YOLOv11 detection model based on the preprocessed dataset; the training is based on the PyTorch framework and adopts an automatic mixed precision training mode; the YOLOv11 detection model includes a backbone network that introduces a cross-stage local bottleneck module C3k2 and a cross-stage local module C2PSA with parallel spatial attention, a neck network that introduces a hybrid convolutional block attention mechanism, and a decoupling head; The hyperparameter optimization module is configured to optimize model parameters using an optimizer and a cosine annealing scheduler. The status output module is configured to input preprocessed video frames into the trained model for frame-by-frame detection and inference, and output results including bounding box positions, component categories, status labels, and confidence scores. Status monitoring and early warning are performed based on changes in the confidence scores.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the real-time detection method for the service status of pipeline fastening equipment as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the real-time detection method for the service status of pipeline fastening equipment as described in any one of claims 1-7.