A method and system for detecting foreign matter in a tower

By replacing the backbone and neck network modules in the YOLOv8 network and combining it with cross-entropy loss function training, the problem of insufficient accuracy in tower foreign object detection is solved, and efficient and accurate foreign object recognition is achieved.

CN120236204BActive Publication Date: 2025-09-09EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510713479.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-09
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

The existing tower foreign body detection method relies on manual inspection, which is inefficient and has poor accuracy. In addition, the YOLO target detection technology based on deep learning has insufficient detection accuracy in tower foreign body detection.

Method used

The YOLOv8 network is used to construct the image recognition network model. The 3CAKCMamba modules are used to replace the C2f module in the backbone network model, and the 4CAKCMamba modules are used to replace the C2f module in the neck network model. The cross entropy loss function is used for training to extract and classify feature images.

Benefits of technology

The accuracy and adaptability of foreign body detection on towers have been improved, and the location and type of foreign bodies can be accurately identified, making it suitable for large-scale promotion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120236204B_ABST
    Figure CN120236204B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for detecting foreign objects in a pole tower. The method comprises: obtaining several pole tower images containing foreign objects; configuring a model training environment, constructing an image recognition network model based on a YOLOv8 network, the image recognition network model comprising at least a backbone network model and a neck network model, wherein the backbone network model uses a 3CAKCMamba module to replace a C2f module, and the neck network model uses a 4CAKCMamba module to replace a C2f module; inputting the pole tower images into the backbone network model and the neck network model for feature extraction; identifying and classifying foreign objects in the extracted feature images based on a cross-entropy loss function to train the image recognition network model; obtaining a pole tower image to be detected, inputting the pole tower image into the trained image recognition network model for recognition, and thereby identifying foreign objects in the pole tower image. The method for detecting foreign objects in the pole tower provided by the present invention has high detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method and system for detecting foreign matter on a tower. Background Art

[0002] Detecting foreign objects on power towers is a critical issue in the power and communications industries. Foreign objects on towers (such as bird nests, kite strings, and advertising banners) can affect the structural stability of the towers, and thus disrupt the normal operation of power or communications networks. Traditional methods for detecting foreign objects rely primarily on manual inspections, which are inefficient, inaccurate, and unable to adapt to complex environmental changes.

[0003] Currently, the deep learning-based YOLO (You Only Look Once) target detection technology is widely used in the target detection field due to its efficient real-time detection capabilities. However, when dealing with the specific scenario of foreign objects on power towers, it still faces problems such as insufficient detection accuracy. Summary of the Invention

[0004] Based on this, the purpose of the present invention is to provide a method and system for detecting foreign matter on a tower to solve the technical problems existing in the prior art.

[0005] The present invention provides a method for detecting foreign matter on a tower, comprising:

[0006] Acquire a number of pole tower images containing foreign objects, preprocess the pole tower images, and divide the preprocessed pole tower images into a training set and a validation set;

[0007] Configure a model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module. In the neck network model, the 4CAKCMamba module is used to replace the C2f module.

[0008] Loading the image recognition network model into the model training environment, and inputting the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction;

[0009] Determining and classifying foreign objects in the extracted feature images based on a cross entropy loss function to train the image recognition network model, and verifying the model training effect using the tower images in the validation set;

[0010] Obtain an image of a tower to be inspected, and input the image of the tower to be inspected into a trained image recognition network model for recognition to determine the location and type of foreign matter on the image of the tower to be inspected.

[0011] Optionally, the step of inputting the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction includes:

[0012] Inputting the tower images in the training set into the backbone network model, sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions;

[0013] Inputting a plurality of the first feature images into the neck network model, performing 4CAKCMamba module processing on the neck network model, and obtaining a plurality of second feature images corresponding to the first feature images.

[0014] Optionally, the step of sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions includes:

[0015] The tower images in the training set are input into the 3CAKCMamba module for CONV convolution processing to extract the local feature maps of the tower images, and the local feature maps are input into the 3CAKCMamba module for abstraction and conversion processing;

[0016] The feature map processed by the 3CAKCMamba module is layer-normalized and then input into the AKSS2D module for feature integration.

[0017] The feature map after feature integration is subjected to the first residual connection operation with the input of the 3CAKCMamba module. The feature map after the first residual connection operation is layer-normalized and then input into the AKCAttention module for recalibration to obtain the first feature image of the first resolution, completing one cycle of the 3CAKCMamba module processing;

[0018] The first feature image of the first resolution is further processed by the above 3CAKCMamba module to obtain a first feature image of the second resolution. Similarly, several first feature images with different resolutions are obtained, wherein the second resolution is higher than the first resolution.

[0019] Optionally, the expression processed by the 3CAKCMamba module is:

[0020] ;

[0021] Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, ψIndicates AKCAttention module processing, LN Representation layer normalization processing, φ Indicates AKSS2D module processing, 3 CAKC Indicates 3CAKCMamba module processing, ω is a convolution with a kernel size of 1x1, and ⊕ represents a residual connection operation;

[0022] The expression processed by the 4CAKCMamba module is:

[0023] ;

[0024] Where, It is the output image feature after processing by 4CAKCMamba module. The input image features processed by 4CAKCMamba modules, 4 CAKC Indicates 4CAKCMamba module processing.

[0025] Optionally, the step of inputting the local feature map into the 3CAKC module for abstraction and conversion processing includes:

[0026] The local feature map is input into the 3CAKCMamba module for CONV convolution processing;

[0027] The feature map after CONV convolution processing in the 3CAKCMamba module is input to the AKCBlock module for judgment processing, and the feature map after judgment processing is connected to the input of the 3CAKCMamba module for the second residual connection operation;

[0028] The feature map after the second residual connection operation is input into the convolutional layer for transformation and refinement to complete the abstraction and conversion of the feature map.

[0029] Optionally, the step of inputting the feature map after the CONV convolution processing in the 3CAKCMamba module into the AKCBlock module for judgment processing includes:

[0030] Perform the first ShortCut judgment on the feature map after CONV convolution processing in the 3CAKCMamba module;

[0031] If the first ShortCut is true, the feature map after CONV convolution in the 3CAKCMamba module is input into AKCONV for variable kernel convolution, and the feature map after variable kernel convolution is subjected to two CONV convolutions. The feature map after the two CONV convolutions is subjected to a third residual connection operation with the input of AKCONV to complete the AKCBlock process;

[0032] If the first ShortCut is judged to be false, the feature map after CONV convolution processing in the 3CAKCMamba module is input into AKCONV for variable kernel convolution processing, and the feature map after variable kernel convolution processing is subjected to two CONV convolution processing and then output to complete the AKCBlock processing.

[0033] Optionally, the expression for the first ShortCut judgment is:

[0034]

[0035] Where, Indicates the output image features after AKCBlock processing when ShortCut is judged to be true. It is a convolution with a convolution kernel size of 1x1, and AKCONV represents variable kernel convolution processing. Represents the input image features processed by AKCBlock, ⊕ represents the residual connection operation, Indicates the output image features after AKCBlock processing when ShortCut is judged to be false.

[0036] Optionally, the step of inputting the layer-normalized feature map into the AKSS2D module for feature integration includes:

[0037] The normalized feature map is input into the linear layer, and matrix multiplication is performed based on the weight matrix in the linear layer to linearly combine the features contained in the feature map;

[0038] The linearly combined feature map is input into the AKCONV layer for dynamic convolution processing to extract the features of foreign objects of different scales or shapes;

[0039] The foreign body features extracted by the AKCONV layer are traversed and scanned to integrate the spatial information in the feature map;

[0040] The scanned features are normalized and then input into the linear layer for processing to complete the feature integration of the feature map.

[0041] Optionally, the step of performing layer normalization processing on the feature map after the first residual connection operation and then inputting the result into the AKC Attention module for recalibration includes:

[0042] Perform the second ShortCut judgment operation on the feature map input into the AKC Attention module;

[0043] If the second ShortCut is true, the normalized feature map is input to AKCONV for variable kernel convolution, the feature map after variable kernel convolution is convolved twice with CONV, the feature map after the two CONV convolutions is connected to the input of AKCONV for the fourth residual connection operation, and the result after the fourth residual connection operation is input to SeAttention for recalibration;

[0044] If the second ShortCut is judged to be false, the normalized feature map is input into AKCONV for variable kernel convolution processing, the feature map after variable kernel convolution processing is subjected to CONV convolution processing twice, and the results after the two CONV convolution processing are input into SeAttention for recalibration.

[0045] The present invention also provides a tower foreign body detection system, comprising:

[0046] A preprocessing module is used to obtain a number of pole tower images containing foreign objects, preprocess the pole tower images, and divide the preprocessed pole tower images into a training set and a validation set;

[0047] A construction module is used to configure a model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module. In the neck network model, the 4CAKCMamba module is used to replace the C2f module.

[0048] An extraction module is used to load the image recognition network model into the model training environment, and input the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction;

[0049] A training module, configured to identify and classify foreign objects in the extracted feature images based on a cross-entropy loss function, so as to train the image recognition network model, and verify the model training effect using the tower images in the validation set;

[0050] The determination module is used to obtain the image of the tower to be detected, input the image of the tower to be detected into the trained image recognition network model for recognition, so as to determine the position and type of foreign matter on the image of the tower to be detected.

[0051] The beneficial effects of the present invention compared with the prior art are as follows: the pole tower foreign body detection method provided by the present application obtains several pole tower images containing foreign bodies and divides them into training and verification sets, constructs an image recognition network model based on the YOLOv8 network, and the image recognition network model includes at least a backbone network model and a neck network model. The 3CAKCMamba module is used to replace the C2f module in the backbone network model, and the 4CAKCMamba module is used to replace the C2f module in the neck network model. The pole tower images in the training set are respectively input into the backbone network model and the neck network model for feature extraction; the 3CAKCMamba module replaces the traditional C2f module. This innovative design makes full use of the AKCONV variable kernel convolution to improve detection accuracy and feature extraction capabilities. The 3CAKCMamba module cleverly combines the three-layer structure to achieve deep mining of feature maps and cross-layer information fusion; the 4CAKCMamba module replaces the traditional C2f module, while maintaining computational efficiency, increases the number of channels of the feature map, and introduces a more complex feature interaction mechanism, which greatly enhances the network's ability to capture multi-scale targets and contextual information. The module not only deepens the feature map through a four-layer finely designed substructure, but also realizes efficient integration and enhancement of features through multi-path aggregation and feature reorganization strategies, providing strong support for target positioning and classification of the head; based on the cross-entropy loss function, the extracted feature images and the actual tower images are used to classify foreign objects to train the image recognition network model; finally, the acquired tower image to be detected is input into the trained image recognition network model to accurately identify the type and location of foreign objects in the tower image; the tower foreign object detection method provided in this application has high recognition accuracy and is suitable for large-scale promotion.

[0052] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 Flowchart of a method for detecting foreign matter on a tower in a first embodiment of the present invention;

[0054] Figure 2 This is the data processing flow chart of the backbone network model and the neck network model;

[0055] Figure 3 3CAKCMamba module data processing flow Figure 1 ;

[0056] Figure 4 Data processing flow for the 4CAKCMamba module Figure 1 ;

[0057] Figure 53CAKCMamba module data processing flow Figure 2 ;

[0058] Figure 6 Data processing flow for the 4CAKCMamba module Figure 2 ;

[0059] Figure 7 This is the data processing flow chart of the AKCBlock module;

[0060] Figure 8 This is the data processing flow chart of the AKSS2D module;

[0061] Figure 9 This is the data processing flow chart of the AKCAttention module;

[0062] Figure 10 4 is a block diagram of the computer structure in the fourth embodiment of the present invention.

[0063] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0064] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0066] Example 1

[0067] See also Figure 1 , which shows a method for detecting foreign matter on a tower in a first embodiment of the present invention, specifically comprising steps S10 to S50:

[0068] S10, obtaining a number of pole tower images containing foreign objects, preprocessing the pole tower images, and dividing the preprocessed pole tower images into a training set and a validation set.

[0069] In practice, a dataset of images containing various foreign objects can be obtained from a tower monitoring system. This dataset includes images of various towers, including bird nests, kite strings, and advertising banners. To increase the diversity of the training data, the images undergo data augmentation preprocessing, including rotation, flipping, brightness adjustment, and hue changes. Furthermore, each image is standardized and resized to a uniform size of 640*640*32 to ensure input data consistency. The preprocessed data is then divided into training and validation sets for subsequent training and validation of the recognition and judgment model.

[0070] S20. Configure the model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module, and in the neck network model, the 4CAKCMamba module is used to replace the C2f module.

[0071] Optionally, the training environment is configured as follows: operating system: Ubuntu 22.04 (x86_64 architecture); hardware: 4 x Intel Xeon CPUs, 40 GB video memory, 500 GB hard disk storage memory; deep learning framework: PyTorch 1.13.1, CUDA 11.7.

[0072] The image recognition network model used in this application is the AKCMamba-YOLO network model. This model is based on the YOLOv8 model and replaces the C2f module in the YOLOv8 model's backbone network with 3CAKCMamba modules, and the C2f module in the YOLOv8 model's neck network with 4CAKCMamba modules. The backbone network extracts features from the input image and converts the image into a multi-scale feature representation so that subsequent network modules can better utilize these features. The neck network further processes the features extracted by the backbone network, integrating features at different levels to generate more effective feature maps.

[0073] S30, loading the image recognition network model into the model training environment, and inputting the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction.

[0074] Optionally, the step of inputting the tower images in the training set into the backbone network model and the neck network model for feature extraction includes:

[0075] The tower images in the training set are input into the backbone network model, and the 3CAKCMamba module processing is performed in sequence in the backbone network model for several cycles to obtain several first feature images with different resolutions;

[0076] A number of first feature images are input into the neck network model, and 4CAKCMamba module processing is performed in the neck network model to obtain a number of second feature images corresponding to the first feature images.

[0077] Optional, such as Figure 2 As shown, in this embodiment, the input image after standardization is 640*640*32, 640*640 represents the width and height of the image respectively, and 32 represents the number of channels; in the backbone network, the input image after standardization may also be convolved through several CONV layers. After the convolution process, the size and number of channels of the image may change; after several CONV convolution processes, the input is processed by the 3CAKCMamba module. Optionally, a CONV convolution process is required before each 3CAKCMamba module process. After several cycles of 3CAKCMamba module processing, the output The resolution of the feature map is different; schematically, in this application, the image after being processed by the 3CAKCMamba module twice is 80*80*256, the image after being processed by the 3CAKCMamba module three times is 40*40*512, and the image after being processed by the 3CAKCMamba module four times is 20*20*1024, and so on, to obtain several first feature images with different resolutions. The higher the resolution, the smaller the size of the foreign body that can be detected; the first feature image is sampled and spliced ​​in the neck network and output through several detection heads; schematically, the 80*80*256 detection head 1 has a low spatial resolution. It is used to capture larger foreign bodies and their locations, and perform classification predictions; the 40*40*512 detection head 2 has a medium spatial resolution, which is suitable for capturing medium-sized foreign bodies and their locations; the 20*20*1024 detection head 3 has a high spatial resolution, which is suitable for capturing small foreign bodies and their locations. Through this multi-scale design, the model can effectively detect foreign bodies of different sizes, thereby improving detection accuracy.

[0078] The steps of sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions include:

[0079] The tower images in the training set are input into the 3CAKCMamba module for CONV convolution processing to extract the local feature maps of the tower images, and the local feature maps are input into the 3CAKCMamba module for abstraction and conversion processing;

[0080] The feature map processed by the 3CAKCMamba module is layer-normalized and then input into the AKSS2D module for feature integration.

[0081] The feature map after feature integration is subjected to the first residual connection operation with the input of the 3CAKCMamba module. The feature map after the first residual connection operation is layer-normalized and then input into the AKCAttention (Adaptive Kernel Correlation Attention, abbreviated as AKCAttention) module for recalibration to obtain the first feature image of the first resolution, completing one cycle of the 3CAKCMamba module processing;

[0082] The first feature image of the first resolution is further processed by the above 3CAKCMamba module to obtain a first feature image of the second resolution. Similarly, several first feature images with different resolutions are obtained, wherein the second resolution is higher than the first resolution.

[0083] Alternatively, as Figure 3As shown in the figure, the image input into the 3CAKCMamba (3CONV Alterable Kernel ConvolutionMamba, variable kernel convolution of 3 convolution modules) module first passes through the CONV convolution layer to extract local features, and then enters the 3CAKCMamba module (abbreviated as: 3CAKC module) to achieve further extraction, abstraction and transformation of features. The 3CAKCMamba module at least includes a deeper understanding of the image such as object and scene recognition. The feature map output from the 3CAKCMamba module will then be processed by layer normalization (Layer Normalization, referred to as Layer Norm). Layer normalization eliminates the difference in data distribution within the layer by normalizing all neurons in the same layer of each sample. Specifically, layer normalization calculates the mean and variance of each sample in each feature dimension, and uses these statistics to normalize the value of the sample in the feature dimension. The feature map after layer normalization then enters AKSS2D (Alterable Kernel Convolution State Space 2D, variable kernel convolution (2D state space) processing, considers information in the spatial dimension to further extract and integrate features. The specific implementation details of the AKSS2D processing layer may vary depending on the model design, and its goal is generally to improve the model's representational capabilities and performance; integrating features means fusing local information into a more global context so that the model can understand the high-level semantics of the image. The image after feature integration is not a complete restoration of the original image, but a high-level feature representation of the image, which is mainly used for subsequent tasks such as classification or detection. Representational capability refers to the model's ability to extract and represent different features from the data, while performance refers to the model's ability to accurately understand and classify the content in the image. After AKSS2D processing, the model sums the result with the input of the 3CAKCMamba module. This summation operation is called a residual connection. By connecting the input directly to a deeper layer, the gradient can flow more easily during backpropagation, thereby avoiding the problem of gradient vanishing or gradient exploding. The summed result will be subjected to layer normalization again to further stabilize the data distribution and prepare for subsequent operations; finally, the model uses the AKC Attention mechanism to process the layer-normalized feature map, focusing more on the important parts of the input data and generating the final output based on this.

[0084] 3The expressions processed by the CAKCMamba module are:

[0085] ;

[0086] Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, ψ Indicates AKCAttention module processing, LN Representation layer normalization processing, φ Indicates AKSS2D module processing, 3 CAKC Indicates 3CAKCMamba module processing, ω is a convolution with a kernel size of 1x1, and ⊕ represents a residual connection operation;

[0087] like Figure 4 As shown in the figure, the processing flow of the 4CAKCMamba (4CONV Alterable Kernel Convolution Mamba; variable kernel convolution of 4 convolution modules) model is similar to that of the 3CAKCMamba model. The difference is that the feature map processed by the CONV convolution layer is sent to the 4CAKCMamba module (abbreviated as: 4CAKC module). The 4CAKC module is the core part of the 4CAKCMamba model to achieve further feature extraction, abstraction and transformation; the expression processed by the 4CAKCMamba module is:

[0088] ;

[0089] Where, It is the output image feature after processing by 4CAKCMamba module. The input image features processed by 4CAKCMamba modules, 4 CAKC Indicates 4CAKCMamba module processing.

[0090] Furthermore, the steps of inputting the local feature map into the 3CAKCMamba module for abstraction and conversion processing include:

[0091] The local feature map is input into the 3CAKCMamba module for CONV convolution processing;

[0092] The feature map after CONV convolution processing in the 3CAKCMamba module is input to the AKCBlock module for judgment processing, and the feature map after judgment processing is connected to the input of the 3CAKCMamba module for the second residual connection operation;

[0093] The feature map after the second residual connection operation is input into the convolutional layer for transformation and refinement to complete the abstraction and conversion of the feature map.

[0094] like Figure 5As shown in the figure, in the 3CAKCMamba module, the input image is first processed by CONV convolution, and the generated feature map contains the spatial structure information of the input data. The feature map processed by CONV convolution is input to the AKCBlock module. After the AKCBlock module is processed, its output is summed with the input of the 3CAKCMamba module. This design not only helps to alleviate the gradient vanishing problem in deep networks, but also promotes the fusion of information between features at different levels, thereby improving the performance of the model. The result of the summation operation is then sent to a convolution layer, and the generated feature map is used for downstream tasks such as classification, detection, and segmentation; as shown in the figure. Figure 6 As shown in the figure, the processing steps in module 4CAKCMamba are optimized based on module 3CAKCMamba. A CONV convolution is added after the Adaptive Kernel Convolution Block (AKCBlock) operation and before the residual summation. This is then summed with the output of the initial convolution layer. This enhances feature representation, promotes feature fusion, and improves model efficiency. The remaining processing steps are similar and are not detailed here.

[0095] 3The expressions processed by the CAKCMamba module are:

[0096] ;

[0097] The expressions processed by the 4CAKCMamba module are:

[0098] ;

[0099] Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, is a convolution with a kernel size of 1x1, ⊕ represents a residual connection operation, AKC Indicates AKCBlock operation, It is the output image feature after processing by 4CAKCMamba module. Input image features processed by the 4CAKCMamba module;

[0100] Optionally, the step of inputting the feature map after the CONV convolution processing in the 3CAKCMamba module into the AKCBlock module for judgment processing includes:

[0101] Perform the first ShortCut judgment on the feature map after CONV convolution processing in the 3CAKCMamba module;

[0102] If the first ShortCut is true, the feature map after CONV convolution in the 3CAKCMamba module is input into AKCONV for variable kernel convolution, and the feature map after variable kernel convolution is subjected to two CONV convolutions. The feature map after the two CONV convolutions is subjected to a third residual connection operation with the input of AKCONV to complete the AKCBlock process;

[0103] If the first ShortCut is judged to be false, the feature map after CONV convolution processing in the 3CAKCMamba module is input into AKCONV for variable kernel convolution processing, and the feature map after variable kernel convolution processing is subjected to two CONV convolution processing and then output to complete the AKCBlock processing.

[0104] like Figure 7 As shown, in the present application, both the 3CAKCMamba module and the 4CAKCMamba module are provided with an AKCBlock module. The AKCBlock module adopts the ShortCut (shortcut connection, also known as residual connection) operation in its design. Through this operation, it flexibly switches between residual connection and direct output, thereby providing the flexibility and stability required for building deep networks. This is a key feature, which determines whether the input feature map is directly added to the feature map processed inside the module; when ShortCut is judged to be true, AKCBlock implements a residual connection, which means that the output of the module will be the sum of the input feature map and the feature map processed by the internal convolution layer. This design helps to solve the problem of gradient disappearance or explosion; when ShortCut is judged to be false, AKCBlock does not need a residual connection. At this time, the output of AKCBlock only contains the feature map processed by the variable kernel convolution AKCONV and the two convolution CONV. AKCONV is a variable kernel convolution method that allows the convolution kernel to have any number of parameters and any sampling shape. It can dynamically adjust its size and shape to accommodate target features of different scales and shapes. It is more accurate and efficient when processing targets with complex shapes and sizes.

[0105] The expression for the first ShortCut judgment is:

[0106] ;

[0107] Where, Indicates the output image features after AKCBlock processing when ShortCut is judged to be true. It is a convolution with a convolution kernel size of 1x1, and AKCONV represents variable kernel convolution processing. Represents the input image features processed by AKCBlock, ⊕ represents the residual connection operation, Indicates the output image features after AKCBlock processing when ShortCut is judged to be false.

[0108] Optional, such as Figure 8 As shown in FIG, the steps of inputting the feature map after layer normalization into the AKSS2D module for feature integration include:

[0109] The normalized feature map is input into the linear layer, and matrix multiplication is performed based on the weight matrix in the linear layer to linearly combine the features contained in the feature map.

[0110] The linearly combined feature map is input into the AKCONV layer for dynamic convolution processing to extract the features of foreign objects of different scales or shapes;

[0111] The foreign body features extracted by the AKCONV layer are traversed and scanned to integrate the spatial information in the feature map;

[0112] The scanned features are then layer-normalized and fed back into the linear layer for processing to complete feature integration of the feature maps. In this application, the AKSS2D module combines the variable kernel convolution (AKCONV) and SS2D, performing variable kernel convolution in two-dimensional space. This module is specifically designed to address the vanishing or exploding gradient problem in deep network training. The AKCONV layer allows the shape and size of the convolution kernel to dynamically change during inference to accommodate features of varying scales and shapes. This makes AKCONV particularly effective for objects with complex shapes and sizes. Within the AKCONV layer, data is processed by a series of dynamic convolution kernels, which automatically adjust their parameters and shapes based on the input data, extracting more accurate and rich features. The scan operation further integrates spatial information for subsequent layer processing. After scanning, the data enters layer normalization, a commonly used normalization technique used to accelerate neural network training and improve model generalization. Finally, the data is output after passing through a linear layer again. This linear layer is usually called the output layer, and its weight and bias parameters are learned according to the training objectives of the model.

[0113] The expressions processed by AKSS2D are:

[0114] ;

[0115] Where, is the output image feature after AKSS2D processing, Input image features processed by AKSS2D, LN represents layer normalization processing, and AKCONV represents AKCONV processing.

[0116] Optionally, the step of performing layer normalization processing on the feature map after the first residual connection operation and then inputting the result into the AKC Attention module for recalibration includes:

[0117] Perform the second ShortCut judgment operation on the feature map input into the AKC Attention module;

[0118] If the second ShortCut is true, the normalized feature map is input to AKCONV for variable kernel convolution, the feature map after variable kernel convolution is convolved twice with CONV, the feature map after the two CONV convolutions is connected to the input of AKCONV for the fourth residual connection operation, and the result of the fourth residual connection operation is input to SeAttention (Self-Attention) for recalibration;

[0119] If the second ShortCut is judged to be false, the normalized feature map is input into AKCONV for variable kernel convolution processing, the feature map after variable kernel convolution processing is subjected to CONV convolution processing twice, and the results after the two CONV convolution processing are input into SeAttention for recalibration.

[0120] Optional, such as Figure 9As shown, the AKC attention module combines the AKCblock and SeAttention mechanisms. This fusion strategy significantly enhances the feature extraction capabilities of deep learning models, thereby improving the accuracy and efficiency of task processing. The input of the AKC attention module first undergoes a ShortCut check. If the ShortCut check is true, the input data first passes through a special convolutional layer called AKCONV, which performs preliminary feature extraction and transformation on the input data. The data processed by AKCONV then enters two CONV convolutional layers, each with different purposes. The first CONV convolutional layer reduces the number of channels in the feature map (i.e., dimensionality reduction), while the second CONV convolutional layer adjusts the number of channels in the feature map to match the data on the ShortCut path. After processing by both convolutional layers, the output of this path is summed with the residual directly passed from the ShortCut path. The residual connection is similar to the one described above and will not be further described here. Finally, the summed result enters the SeAttention module, which learns the dependencies between feature channels and recalibrates the feature map to enhance features useful for the task and suppress unimportant features. This step further improves the quality of feature representation and provides stronger support for subsequent detection tasks. If ShortCut is false, the input data does not require a residual connection and is directly output after entering the two CONV convolutional layers.

[0121] The second ShortCut judgment expression in the AKCAtention module is:

[0122] ;

[0123] Where, Indicates the output image features after AKCAtention processing when ShortCut is judged to be true. SA Represents SeAttention processing, ω is a convolution with a convolution kernel size of 1x1, and AKCONV represents variable kernel convolution processing. Represents the input image features processed by AKCAtention, ⊕ represents the residual connection operation, Indicates the output image features after AKCAtention processing when ShortCut is judged to be false.

[0124] S40. Identify and classify foreign objects in the extracted feature images based on the cross entropy loss function to train the image recognition network model, and verify the model training effect through the tower images in the verification set.

[0125] Optionally, during training, a cross-entropy loss function is used for target classification and regression. The hyperparameters used during training are: Epochs = 500, Batch Size = 32, Initial Learning Rate = 0.01, Final Learning Rate = 0.1, Optimizer: SGD, and Loss Function: Cross-Entropy Loss. Epochs represents the number of rounds. Epochs = 500 means the model will repeatedly learn the entire dataset 500 times. Batch represents a small number of data samples fed into the model at each iteration. Batch Size = 32 means each time the model updates its parameters, it calculates gradients based on 32 samples. During training, the model is adjusted by real-time monitoring logs to ensure convergence. Training epochs are set to 500, and detection objects include bird nests, balloons, kite strings, and aircraft.

[0126] S50: Acquire an image of a tower to be detected, and input the image of the tower to be detected into a trained image recognition network model for recognition, so as to determine the position and type of foreign matter on the image of the tower to be detected.

[0127] The image to be detected is used as input, and foreign objects on the tower are detected through the trained and verified image recognition network model. Finally, the location and category of the foreign object in each image are output, the target is located and a bounding box is generated. The detection accuracy can be evaluated by indicators such as the accuracy APval(%) of the validation set; for example, the accuracy APval50(%) of the validation set calculated when the IoU (Intersection over Union) threshold is 0.5 and the accuracy APval75(%) of the validation set calculated when the IoU threshold is 0.75.

[0128] The test results of the AKCMamba-YOLO network model provided in this application and the original YOLOv8 network model are shown in Table 1.

[0129]

[0130] As shown in Table 1, AKCMamba-YOLO achieves a 3.1% improvement in Precision, a metric that directly reflects model recognition accuracy, compared to the YOLOv8 source code. This improvement means that when identifying various foreign objects attached to power poles (such as bird nests, kite strings, and advertising banners), AKCMamba-YOLO can more accurately distinguish between targets and non-targets, reducing false positives and false negatives, and providing a more reliable basis for subsequent maintenance and cleanup. AKCMamba-YOLO also demonstrates strong performance in Mean Average Precision (mAP). At an Intersection over Union (IoU) threshold of 0.5, or mAP50, AKCMamba-YOLO achieves a 3.6% improvement. This indicates that the model's predicted bounding boxes overlap significantly with the ground-truth bounding boxes when detecting objects, significantly improving localization accuracy. Furthermore, within a stricter IoU threshold range (0.5 to 0.95), i.e., mAP50-95, AKCMamba-YOLO achieved a 5.1% improvement. This result not only demonstrates the model's robustness across multiple IoU thresholds, but also demonstrates its robustness in handling foreign objects on towers of varying sizes, shapes, and occlusion levels.

[0131] In summary, the pole tower foreign body detection method provided by this application obtains several pole tower images containing foreign bodies and divides them into training and verification sets, and constructs an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. The 3CAKCMamba module is used to replace the C2f module in the backbone network model, and the 4CAKCMamba module is used to replace the C2f module in the neck network model. The pole tower images in the training set are respectively input into the backbone network model and the neck network model for feature extraction; the 3CAKCMamba module replaces the traditional C2f module. This innovative design makes full use of the AKCONV variable kernel convolution to improve detection accuracy and feature extraction capabilities. The 3CAKCMamba module cleverly combines the three-layer structure to achieve deep mining of feature maps and cross-layer information fusion; the 4CAKCMamba module replaces the traditional C2f module. While maintaining computational efficiency, it increases the number of channels of the feature map and introduces a more complex feature interaction mechanism, which greatly enhances the network's ability to capture multi-scale targets and contextual information. The module not only deepens the feature map through a four-layer finely designed substructure, but also realizes efficient integration and enhancement of features through multi-path aggregation and feature reorganization strategies, providing strong support for target positioning and classification of the head; based on the cross-entropy loss function, the extracted feature images and the actual tower images are used to classify foreign objects to train the image recognition network model; finally, the acquired tower image to be detected is input into the trained image recognition network model to accurately identify the type and location of foreign objects in the tower image; the tower foreign object detection method provided in this application has high recognition accuracy and is suitable for large-scale promotion.

[0132] Example 2

[0133] This embodiment provides a tower foreign body detection system, comprising:

[0134] A preprocessing module is used to obtain a number of pole tower images containing foreign objects, preprocess the pole tower images, and divide the preprocessed pole tower images into a training set and a validation set;

[0135] A construction module is used to configure a model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module. In the neck network model, the 4CAKCMamba module is used to replace the C2f module.

[0136] An extraction module is used to load the image recognition network model into the model training environment, and input the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction;

[0137] A training module, configured to identify and classify foreign objects in the extracted feature images based on a cross-entropy loss function, so as to train the image recognition network model, and verify the model training effect using the tower images in the validation set;

[0138] The determination module is used to obtain the image of the tower to be detected, input the image of the tower to be detected into the trained image recognition network model for recognition, so as to determine the position and type of foreign matter on the image of the tower to be detected.

[0139] Optionally, the step of inputting the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction includes:

[0140] Inputting the tower images in the training set into the backbone network model, sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions;

[0141] Inputting a plurality of the first feature images into the neck network model, performing 4CAKCMamba module processing on the neck network model, and obtaining a plurality of second feature images corresponding to the first feature images.

[0142] Optionally, the step of sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions includes:

[0143] The tower images in the training set are input into the 3CAKCMamba module for CONV convolution processing to extract the local feature maps of the tower images, and the local feature maps are input into the 3CAKCMamba module for abstraction and conversion processing;

[0144] The feature map processed by the 3CAKCMamba module is layer-normalized and then input into the AKSS2D module for feature integration.

[0145] The feature map after feature integration is subjected to the first residual connection operation with the input of the 3CAKCMamba module. The feature map after the first residual connection operation is layer-normalized and then input into the AKCAttention module for recalibration to obtain the first feature image of the first resolution, completing one cycle of the 3CAKCMamba module processing;

[0146] The first feature image of the first resolution is further processed by the above 3CAKCMamba module to obtain a first feature image of the second resolution. Similarly, several first feature images with different resolutions are obtained, wherein the second resolution is higher than the first resolution.

[0147] Optionally, the expression processed by the 3CAKCMamba module is:

[0148] ;

[0149] Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, ψ Indicates AKCAttention module processing, LN Representation layer normalization processing, φ Indicates AKSS2D module processing, 3 CAKC Indicates 3CAKCMamba module processing, ω is a convolution with a kernel size of 1x1, and ⊕ represents a residual connection operation;

[0150] The expression processed by the 4CAKCMamba module is:

[0151] ;

[0152] Where, It is the output image feature after processing by 4CAKCMamba module. The input image features processed by 4CAKCMamba modules, 4 CAKC Indicates 4CAKCMamba module processing.

[0153] Optionally, the step of inputting the local feature map into the 3CAKCMamba module for abstraction and conversion processing includes:

[0154] The local feature map is input into the 3CAKCMamba module for CONV convolution processing;

[0155] The feature map after CONV convolution processing in the 3CAKCMamba module is input to the AKCBlock module for judgment processing, and the feature map after judgment processing is connected to the input of the 3CAKCMamba module for the second residual connection operation;

[0156] The feature map after the second residual connection operation is input into the convolutional layer for transformation and refinement to complete the abstraction and conversion of the feature map.

[0157] Optionally, the step of inputting the feature map after CONV convolution processing in the 3CAKCMamba module into the AKCBlock module for judgment processing includes:

[0158] Perform the first ShortCut judgment on the feature map after CONV convolution processing in the 3CAKCMamba module;

[0159] If the first ShortCut is true, the feature map after CONV convolution in the 3CAKCMamba module is input into AKCONV for variable kernel convolution, and the feature map after variable kernel convolution is subjected to two CONV convolutions. The feature map after the two CONV convolutions is subjected to a third residual connection operation with the input of AKCONV to complete the AKCBlock process;

[0160] If the first ShortCut is judged to be false, the feature map after CONV convolution processing in the 3CAKCMamba module is input into AKCONV for variable kernel convolution processing, and the feature map after variable kernel convolution processing is subjected to two CONV convolution processing and then output to complete the AKCBlock processing.

[0161] Optionally, the expression for the first ShortCut judgment is:

[0162] ;

[0163] Where, Indicates the output image features after AKCBlock processing when ShortCut is judged to be true. It is a convolution with a convolution kernel size of 1x1, and AKCONV represents variable kernel convolution processing. Represents the input image features processed by AKCBlock, ⊕ represents the residual connection operation, Indicates the output image features after AKCBlock processing when ShortCut is judged to be false.

[0164] Optionally, the step of inputting the layer-normalized feature map into the AKSS2D module for feature integration includes:

[0165] The normalized feature map is input into the linear layer, and matrix multiplication is performed based on the weight matrix in the linear layer to linearly combine the features contained in the feature map;

[0166] The linearly combined feature map is input into the AKCONV layer for dynamic convolution processing to extract the features of foreign objects of different scales or shapes;

[0167] The foreign body features extracted by the AKCONV layer are traversed and scanned to integrate the spatial information in the feature map;

[0168] The scanned features are normalized and then input into the linear layer for processing to complete the feature integration of the feature map.

[0169] Optionally, the step of performing layer normalization processing on the feature map after the first residual connection operation and then inputting the result into the AKC Attention module for recalibration includes:

[0170] Perform the second ShortCut judgment operation on the feature map input into the AKC Attention module;

[0171] If the second ShortCut is true, the normalized feature map is input to AKCONV for variable kernel convolution, the feature map after variable kernel convolution is convolved twice with CONV, the feature map after the two CONV convolutions is connected to the input of AKCONV for the fourth residual connection operation, and the result after the fourth residual connection operation is input to SeAttention for recalibration;

[0172] If the second ShortCut is judged to be false, the normalized feature map is input into AKCONV for variable kernel convolution processing, the feature map after variable kernel convolution processing is subjected to CONV convolution processing twice, and the results after the two CONV convolution processing are input into SeAttention for recalibration.

[0173] Example 3

[0174] This embodiment provides a storage medium having a computer program stored thereon. When the program is executed by a processor, the above-mentioned method for detecting foreign matter on a tower is implemented.

[0175] Example 4

[0176] The present invention also provides a computer, see Figure 10 , shown is a computer in an embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned tower foreign body detection method is implemented.

[0177] The memory 10 includes at least one type of storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10 may be an internal storage unit of a computer, such as the computer's hard disk. In other embodiments, the memory 10 may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 10 may include both an internal storage unit of the computer and an external storage device. The memory 10 can be used not only to store application software installed in the computer and various types of data, but also to temporarily store data that has been output or is about to be output.

[0178] Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs.

[0179] It should be pointed out that Figure 10 The structure shown does not constitute a limitation of the computer. In other embodiments, the computer may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0180] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.

[0181] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting, or processing it in another suitable manner as necessary, and then storing it in a computer memory.

[0182] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the aforementioned embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following technologies known in the art may be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.

[0183] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned 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.

[0184] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A method for detecting foreign matter on a tower, characterized in that: include: Acquire a number of pole tower images containing foreign objects, preprocess the pole tower images, and divide the preprocessed pole tower images into a training set and a validation set; Configure a model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module. In the neck network model, the 4CAKCMamba module is used to replace the C2f module. Loading the image recognition network model into the model training environment, and inputting the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction; Determining and classifying foreign objects in the extracted feature images based on a cross entropy loss function to train the image recognition network model, and verifying the model training effect using the tower images in the validation set; Obtain an image of a tower to be inspected, and input the image into a trained image recognition network model for recognition to determine the location and type of foreign matter on the image of the tower to be inspected; Among them, the 3CAKCMamba module includes the 3CAKC module, the convolution conv module and the AKCBlock module; the 4CAKCMamba module includes the 4CAKC module, the convolution conv module and the AKCBlock module, among which: The expression processed by the 3CAKCMamba module is: ; Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, ψ Indicates AKCAttention module processing, LN Representation layer normalization processing, φ Indicates AKSS2D module processing, 3 CAKC Indicates 3CAKC module processing, ω is a convolution with a kernel size of 1x1, and ⊕ represents a residual connection operation; The AKSS2D module is a combination of the variable kernel convolution AKCONV and SS2D, including a linear layer, a variable kernel convolution AKCONV, and Scan. The input of the AKC Attention module first executes the ShortCut judgment mechanism. If the ShortCut judgment is true, the input data will first pass through the special convolution layer AKCONV to perform preliminary feature extraction and transformation on the input data. The data processed by the AKCONV module in the AKCAttention module will enter two CONV convolutional layers in sequence. The first CONV convolutional layer is used to reduce the number of channels of the feature map, while the second CONV convolutional layer is used to adjust the number of channels of the feature map to match the data on the ShortCut path. After completing the processing of the two convolutional layers, the system will sum the output of this path with the residual directly passed from the ShortCut path. The expression processed by the 4CAKCMamba module is: ; Where, It is the output image feature after processing by 4CAKCMamba module. The input image features processed by the 4CAKCMamba module, 4 CAKC Indicates 4CAKC module processing; Among them, the expression processed by the 3CAKC module is: ; The expression processed by the 4CAKC module is: ; Where, is the output image feature after processing by the 3CAKC module, is the input image feature processed by the 3CAKC module, ω is the convolution with a kernel size of 1x1, ⊕ represents the residual connection operation, AKC Indicates AKCBlock operation, is the output image feature after processing by the 4CAKC module, Input image features processed by the 4CAKC module; Among them, the AKCBlock module performs a first ShortCut judgment on the feature map after CONV convolution processing in the 3CAKC module; if the first ShortCut judgment is true, the feature map after CONV convolution processing in the 3CAKC module is input into AKCONV for variable kernel convolution processing, and the feature map after variable kernel convolution processing is CONV convolution processed twice, and the feature map after the two CONV convolution processing is subjected to a third residual connection operation with the input of AKCONV to complete the AKCBlock processing; if the first ShortCut judgment is false, the feature map after CONV convolution processing in the 3CAKC module is input into AKCONV for variable kernel convolution processing, and the feature map after the variable kernel convolution processing is CONV convolution processed twice and then output to complete the AKCBlock processing.

2. The method for detecting foreign matter on a tower according to claim 1, wherein: The step of inputting the tower images in the training set into the backbone network model and the neck network model for feature extraction comprises: Inputting the tower images in the training set into the backbone network model, sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions; Inputting a plurality of the first feature images into the neck network model, performing 4CAKCMamba module processing on the neck network model, and obtaining a plurality of second feature images corresponding to the first feature images.

3. The method for detecting foreign matter on a tower according to claim 2, wherein: The step of sequentially performing several cycles of 3CAKCMamba module processing in the backbone network model to obtain several first feature images with different resolutions includes: The tower images in the training set are input into the 3CAKCMamba module for CONV convolution processing to extract the local feature maps of the tower images, and the local feature maps are input into the 3CAKCMamba module for abstraction and conversion processing; The feature map processed by the 3CAKCMamba module is layer-normalized and then input into the AKSS2D module for feature integration. The feature map after feature integration is subjected to the first residual connection operation with the input of the 3CAKCMamba module. The feature map after the first residual connection operation is layer-normalized and then input into the AKCAttention module for recalibration to obtain the first feature image of the first resolution, completing one cycle of the 3CAKCMamba module processing; The first feature image of the first resolution is further processed by the above 3CAKCMamba module to obtain a first feature image of the second resolution. Similarly, several first feature images with different resolutions are obtained, wherein the second resolution is higher than the first resolution.

4. The method for detecting foreign matter on a tower according to claim 3, wherein: The steps of inputting the local feature map into the 3CAKCMamba module for abstraction and conversion include: The local feature map is input into the 3CAKC module for CONV convolution processing; The feature map after CONV convolution processing in the 3CAKC module is input to the AKCBlock module for judgment processing, and the feature map after judgment processing is connected with the input of the 3CAKC module for the second residual connection operation; The feature map after the second residual connection operation is input into the convolution layer for transformation and refinement to complete the abstraction and conversion of the feature map; Among them, the AKCBlock module includes the changeable kernel convolution AKCONV, convolution CONV and ShortCut operations.

5. The method for detecting foreign matter on a tower according to claim 1, wherein: The expression for the first ShortCut judgment is: Where, Indicates the output image features after AKCBlock processing when ShortCut is judged to be true. It is a convolution with a convolution kernel size of 1x1, and AKCONV represents variable kernel convolution processing. Represents the input image features processed by AKCBlock, ⊕ represents the residual connection operation, Indicates the output image features after AKCBlock processing when ShortCut is judged to be false.

6. The method for detecting foreign matter on a tower according to claim 3, characterized in that: The steps of inputting the layer-normalized feature map into the AKSS2D module for feature integration include: The normalized feature map is input into the linear layer, and matrix multiplication is performed based on the weight matrix in the linear layer to linearly combine the features contained in the feature map; The linearly combined feature map is input into the AKCONV layer for dynamic convolution processing to extract the features of foreign objects of different scales or shapes; The foreign body features extracted by the AKCONV layer are traversed and scanned to integrate the spatial information in the feature map; The scanned features are normalized and then input into the linear layer for processing to complete the feature integration of the feature map.

7. The method for detecting foreign matter on a tower according to claim 3, wherein: The step of performing layer normalization on the feature map after the first residual connection operation and then inputting the result into the AKC Attention module for recalibration includes: Perform the second ShortCut judgment operation on the feature map input into the AKC Attention module; If the second ShortCut is true, the normalized feature map is input to AKCONV for variable kernel convolution, the feature map after variable kernel convolution is convolved twice with CONV, the feature map after the two CONV convolutions is connected to the input of AKCONV for the fourth residual connection operation, and the result after the fourth residual connection operation is input to SeAttention for recalibration; If the second ShortCut is judged as false, the normalized feature map is input to AKCONV for variable kernel convolution, the feature map after variable kernel convolution is convolved twice by CONV, and the results of the two CONV convolutions are input to SeAttention for recalibration; Among them, the AKCAttention module includes the changeable kernel convolution AKCONV, convolution conv, ShortCut operation and SeAttention attention mechanism.

8. A tower foreign body detection system, characterized in that: include: A preprocessing module is used to obtain a number of pole tower images containing foreign objects, preprocess the pole tower images, and divide the preprocessed pole tower images into a training set and a validation set; A construction module is used to configure a model training environment and build an image recognition network model based on the YOLOv8 network. The image recognition network model includes at least a backbone network model and a neck network model. In the backbone network model, the 3CAKCMamba module is used to replace the C2f module. In the neck network model, the 4CAKCMamba module is used to replace the C2f module. An extraction module is used to load the image recognition network model into the model training environment, and input the tower images in the training set into the backbone network model and the neck network model respectively for feature extraction; A training module, configured to identify and classify foreign objects in the extracted feature images based on a cross-entropy loss function, so as to train the image recognition network model, and verify the model training effect using the tower images in the validation set; A determination module is used to obtain an image of a tower to be detected, input the image of the tower to be detected into a trained image recognition network model for recognition, so as to determine the location and type of foreign matter on the image of the tower to be detected; Among them, the 3CAKCMamba module includes the 3CAKC module, the convolution conv module and the AKCBlock module; the 4CAKCMamba module includes the 4CAKC module, the convolution conv module and the AKCBlock module, among which: The expression processed by the 3CAKCMamba module is: ; Where, It is the output image feature after processing by 3CAKCMamba module. Input image features processed by the 3CAKCMamba module, ψ Indicates AKCAttention module processing, LN Representation layer normalization processing, φ Indicates AKSS2D module processing, 3 CAKC Indicates 3CAKC module processing, ω is a convolution with a kernel size of 1x1, and ⊕ represents a residual connection operation; The AKSS2D module is a combination of the variable kernel convolution AKCONV and SS2D, including a linear layer, a variable kernel convolution AKCONV, and Scan. The input of the AKC Attention module first executes the ShortCut judgment mechanism. If the ShortCut judgment is true, the input data will first pass through the special convolution layer AKCONV to perform preliminary feature extraction and transformation on the input data. The data processed by the AKCONV module in the AKCAttention module will enter two CONV convolutional layers in sequence. The first CONV convolutional layer is used to reduce the number of channels of the feature map, while the second CONV convolutional layer is used to adjust the number of channels of the feature map to match the data on the ShortCut path. After completing the processing of the two convolutional layers, the system will sum the output of this path with the residual directly passed from the ShortCut path. The expression processed by the 4CAKCMamba module is: ; Where, It is the output image feature after processing by 4CAKCMamba module. The input image features processed by the 4CAKCMamba module, 4 CAKC Indicates 4CAKC module processing; Among them, the expression processed by the 3CAKC module is: ; The expression processed by the 4CAKC module is: ; Where, is the output image feature after processing by the 3CAKC module, is the input image feature processed by the 3CAKC module, ω is the convolution with a kernel size of 1x1, ⊕ represents the residual connection operation, AKC Indicates AKCBlock operation, is the output image feature after processing by the 4CAKC module, Input image features processed by the 4CAKC module; Among them, the AKCBlock module performs a first ShortCut judgment on the feature map after CONV convolution processing in the 3CAKC module; if the first ShortCut judgment is true, the feature map after CONV convolution processing in the 3CAKC module is input into AKCONV for variable kernel convolution processing, and the feature map after variable kernel convolution processing is CONV convolution processed twice, and the feature map after the two CONV convolution processing is subjected to a third residual connection operation with the input of AKCONV to complete the AKCBlock processing; if the first ShortCut judgment is false, the feature map after CONV convolution processing in the 3CAKC module is input into AKCONV for variable kernel convolution processing, and the feature map after the variable kernel convolution processing is CONV convolution processed twice and then output to complete the AKCBlock processing.

Citation Information

Patent Citations

  • Small target detection method based on improved YOLOv8

    CN118552716A

  • Improved YOLOv8 tower foundation target detection method and device

    CN119048736A