Conductive lead metal corrosion detection method based on image recognition
Through the improved image recognition algorithms StarNet-Yolov8 and AKConv-Yolov8, the metal rust of conductive leads is automatically detected, solving the problems of low efficiency and poor accuracy of traditional manual inspections, and achieving fast and accurate metal rust detection.
Patent Information
- Application Number
- CN202411445032.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-14
AI Technical Summary
Traditional conductive lead metal corrosion detection relies on manual inspection, which is low efficiency and poor accuracy, is prone to missed or missed inspection, and is time-consuming and labor-intensive.
Using image recognition-based detection methods, the improved StarNet-Yolov8 and AKConv-Yolov8 algorithms are used to generate metal rust detection results by shooting conductive lead scenes, segmenting images, and detecting corrosion areas, thereby improving detection accuracy and efficiency.
It realizes automated, fast and accurate metal corrosion detection of conductive leads, improves detection efficiency and accuracy, reduces the limitations of manual inspection, and maintains efficient detection performance in complex scenarios and multi-scale targets.
Smart Images

Figure CN119313643A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of power equipment monitoring, and in particular relates to a conductive lead metal corrosion detection method based on image recognition. Background Art
[0002] In the traditional power industry, metal corrosion detection of conductive leads is a crucial area. Conductive leads are an important link in connecting electrical equipment and transmitting electrical energy, and their normal operation is directly related to the safety and stability of the power system. Metal corrosion is an inevitable problem after long-term use of conductive leads, which may lead to increased contact resistance, decreased transmission capacity, and even cause serious consequences such as fire.
[0003] Traditional detection of metal corrosion of conductive leads usually relies on manual inspections, which has the following problems: Limitations of manual inspection: Manual inspection requires a lot of manpower and material resources, is time-consuming and labor-intensive, and is easily affected by subjective factors, resulting in low detection efficiency.
[0004] Detection accuracy: Manual inspections cannot ensure that each item is carefully checked, and may lead to missed or misdetected items. Summary of the invention
[0005] The technical purpose of the present invention is to provide a conductive lead metal corrosion detection method based on image recognition to solve the problem of various limitations in manual inspection of conductive lead corrosion.
[0006] To solve the above problems, the technical solution of the present invention is: A conductive lead metal corrosion detection method based on image recognition comprises the following steps: Shoot in the direction of the target object to be detected, obtain the corresponding scene image, and obtain image data; The image data is segmented using the improved StarNet-Yolov8 algorithm to obtain the segmented image of the target object to be detected; Based on the improved AKConv-Yolov8 algorithm, metal corrosion detection is performed on the segmented area of the segmented image, and the corresponding conductive lead metal corrosion detection results are generated; After repeating the above steps for several rounds, effective metal corrosion information of the conductive lead is obtained; The improved StarNet-Yolov8 algorithm includes a backbone network, a neck network, and a head network. It adopts an anchor-free mechanism and replaces the backbone network of the Yolov8 model with a StarNet module to more efficiently extract and represent image features. The improved AKConv-Yolov8 algorithm includes a backbone network, a neck network and a head network. It adopts an anchor-free mechanism and introduces AKConv's new convolution operation into the Yolov8 model. At least one standard convolution layer in the original Yolov8 model is replaced by AKConv, and the convolution kernel is dynamically adjusted according to the features of the input image to improve the flexibility of feature extraction.
[0007] Obtaining the image data specifically includes: calling the camera to turn to the position of the target object to be detected and recording the position coordinates; starting to take pictures, obtaining image data, and sending the image data, callback interface and AI parameters to the AI platform to perform image segmentation and metal corrosion detection.
[0008] The image data is segmented using the improved StarNet-Yolov8 algorithm as follows: the picture data is decoded, and scaled and standardized preprocessed to generate a set of image data; the image data is sent to the improved StarNet-Yolov8 algorithm for processing, the pixel area of the conductive lead position that needs to be paid attention to in the image data is segmented from the background pixel area, and semantic labels associated with the conductive lead are assigned to them.
[0009] Specifically, since the StarNet module maps input data to a high-dimensional space, the SGD optimizer is used in the StarNet-Yolov8 algorithm to adjust the learning rate during model training. The SGD optimizer is combined with the momentum method to prevent fluctuations in parameter updates during the iteration of the SGD optimizer. The momentum method adds the exponential weighted average of the gradient to the SGD optimizer. The calculation formula is: in, is the cumulative value of momentum, indicating the accumulation of current and past gradients, is the momentum factor, is the current gradient, is the number of steps of the current iteration; The calculation formula for parameter update is: in, is the learning rate, is the current parameter of the model.
[0010] Among them, the metal corrosion detection of the segmented area of the segmented image based on the improved AKConv-Yolov8 algorithm is specifically as follows: the input segmented image is processed by the improved AKConv-Yolov8 algorithm, and the metal area with the possibility of corrosion is detected and framed through the detection frame, and the position and category information of each detected metal area is obtained, and an image with annotations is generated; the metal area in the annotated image is cropped to obtain multiple image blocks; the multiple image blocks are processed for corrosion in turn, and the characteristics of the rusted area in each image block, including the rusted area and the rusted position, are determined to determine whether the conductive lead is rusted.
[0011] Specifically, the parameters in the AKConv-Yolov8 algorithm are set as follows: while keeping the original image aspect ratio, set the input image resolution imgsz to 416; set the size of the detection box anchor_scale=2.2; adjust the Iou threshold to 0.45; set the classification loss cls_pw to 1.3, and the target loss weight obj_pw to 1.45; enable data augmentation, set random cropping to 0.1, scaling to 0.3, rotation to 20, upside down flipping to 0.5, left-right flipping to 0.5, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636; and set the extension round to 600.
[0012] Among them, the adaptive learning rate adjustment algorithm AdamW is used in the AKConv-Yolov8 algorithm to improve the generalization ability of the model. Its formula is: in, is the weight attenuation coefficient, set to 0.888, is the momentum coefficient, set to 0.995.
[0013] A computer device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the conductive lead metal corrosion detection method based on image recognition as described above.
[0014] A storage medium storing computer-readable instructions, when the computer-readable instructions are executed by one or more processors, enables the one or more processors to execute the above-mentioned conductive lead metal corrosion detection method.
[0015] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art: The present invention introduces the StarNet module into the StarNet-Yolov8 algorithm model to improve the performance of Yolov8. The StarNet module uses improved feature extraction and fusion technology to make the model perform better when processing complex scenes and multi-scale targets. The StarNet module can better capture the detailed features in the image, especially in complex backgrounds and occlusions, thereby improving the detection accuracy of the model. By introducing multi-scale feature fusion technology, StarNet-YOLOv8 performs more stably and accurately when detecting targets of different sizes. The StarNet module improves the robustness of the model under different environments and lighting conditions, so that the model can maintain efficient detection performance in various scenarios. Despite the introduction of additional feature extraction modules, StarNet-YOLOv8 still maintains the advantages of the YOLO series algorithms in terms of computational efficiency and can achieve real-time detection.
[0016] The AKConv-Yolov8 algorithm model combines adaptive convolution (AKConv) technology, which enables the convolution kernel to be dynamically adjusted according to the features of the input image, thereby improving the flexibility and accuracy of feature extraction. AKConv dynamically adjusts the shape and size of the convolution kernel, allowing the model to more flexibly adapt to targets of different shapes and scales, improving detection accuracy. The adaptive convolution kernel can be reduced as needed, which performs well when detecting small targets and solves the limitations of traditional convolution kernels when processing small targets. AKConv makes the model more stable and consistent in different data sets and tasks, without the need to manually adjust the convolution kernel, simplifying the model design and optimization process. Despite the introduction of a complex convolution kernel adjustment mechanism, the AKConv-Yolov8 algorithm model maintains fast training and inference speeds through efficient computational design.
[0017] Both improvements significantly improve detection accuracy by enhancing feature extraction and fusion technology, especially in complex scenes and multi-scale target detection. The introduction of StarNet and AKConv makes the model more adaptable and robust under different environments, lighting and background conditions, and can cope with a wider range of application scenarios. Despite a large number of improvements, StarNet-Yolov8 and AKConv-Yolov8 still maintain the real-time detection characteristics of the YOLO series of algorithms in terms of computational efficiency, and are suitable for practical applications that require fast response. Adaptive convolution kernels and multi-scale feature fusion technology reduce the need for manual adjustment of model parameters, simplify the design and optimization process of the model, and make the migration and application of the model in different tasks more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0019] Figure 1 It is a flow chart of a conductive lead metal corrosion detection method based on image recognition of the present invention; Figure 2 The improved StarNet-Yolov8 algorithm architecture diagram of the present invention; Figure 3 This is the improved AKConv-Yolov8 algorithm architecture diagram of the present invention. DETAILED DESCRIPTION
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0021] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0022] The following is a further detailed description of a conductive lead metal corrosion detection method based on image recognition proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims.
[0023] See also Figures 1 to 3 , a conductive lead metal corrosion detection method based on image recognition, comprising the following steps: First, the detection system calls the camera to turn to the location of the target object to be detected, records the corresponding position coordinates, and then shoots to obtain the corresponding scene image to obtain image data. Then the image data, callback interface and AI parameters are sent to the AI platform for subsequent image segmentation and metal corrosion detection.
[0024] Then, the AI platform segments the received image data using the improved StarNet-Yolov8 algorithm to obtain a segmented image of the target object to be detected. The specific steps are: decode the image data, perform scale scaling and standardization preprocessing, and generate a set of image data. The image data is sent to the improved StarNet-Yolov8 algorithm for processing, and the pixel area of the conductive lead position that needs to be paid attention to in the image data is segmented from the background pixel area, and a semantic label associated with the conductive lead is assigned to it.
[0025] See also Figure 2 StarNet-Yolov8 is a deep learning algorithm model suitable for real-time target detection tasks. By introducing StarNet (Simulated Attention Mechanism) modules, anchor-free mechanisms (Anchor-Free) and multi-scale feature fusion and other technical improvements, it can better enhance the quality of feature representation and improve the accuracy and efficiency of target detection. Among them, the improved StarNet-Yolov8 algorithm includes a backbone network (backbone), a neck network (neck) and a head network (head). The backbone network uses an efficient convolutional neural network structure for feature extraction to ensure that the model achieves a balance between efficiency and accuracy in real-time detection. StarNet-Yolov8 can provide more accurate and reliable detection results when dealing with complex scenes and diverse targets, becoming a target detection model that performs outstandingly in terms of real-time and accuracy.
[0026] In computer vision tasks, the backbone network is responsible for extracting the basic features of the image and is the basis of the entire network. The traditional Yolov8 network uses a standard convolutional neural network (CNN) as the backbone network. In this embodiment, the main improvement of StarNet-Yolov8 is that the backbone network of the basic Yolov8 model adopts the StarNet module. The StarNet module simulates the attention mechanism and dynamically adjusts the weights of the feature map without significantly increasing the computational overhead, thereby strengthening important features and suppressing irrelevant features, thereby improving the detection accuracy. The introduction of the StarNet module can map the input data to a high-dimensional, nonlinear feature space without expanding the network. This feature greatly improves the expressiveness and performance of the model. When facing complex images, traditional convolutional neural networks may need to increase the width of the network (i.e., increase the number of convolutional layers and the amount of parameters) to improve performance. However, doing so will significantly increase the computational complexity and energy consumption of the model. The StarNet module can demonstrate high performance and low latency under a compact network structure and an efficient budget, which means that even at a smaller network scale, the model can still show excellent performance.
[0027] In addition, in modern deep learning applications, the energy consumption and latency of the model are two very important indicators. The improved StarNet-Yolov8 achieves the goal of significantly improving performance while maintaining a compact network structure by introducing the StarNet module. The StarNet module reduces the computational complexity and energy consumption of the model through a more efficient calculation and feature extraction mechanism. This low energy consumption and low latency feature makes the improved StarNet-YOLOv8 particularly suitable for resource-constrained environments. For example, on mobile devices, embedded systems, and edge computing devices, resources (such as computing power, battery life, etc.) are often very limited. In these scenarios, traditional large-scale deep learning models may not be applicable. The compact structure and efficient performance of StarNet-YOLOv8 make it an ideal choice for these application scenarios.
[0028] Specifically, the star operation in the StarNet module is similar to a kernel function, which performs pairwise multiplications on features across different channels, especially a polynomial kernel function. When the star operation is incorporated into a neural network and multiple layers are stacked, each layer will lead to an exponential growth in the complexity of the implicit dimension. With just a few layers, the star operation can achieve almost unlimited dimensions in a compact feature space.
[0029] In a single-layer neural network, the star operation is usually written as: Represents the fusion of two linear transformation features through element-wise multiplication.
[0030] The matrix form is: Where W = , X = .
[0031] The computation is performed using the computationally efficient star operation in a d-dimensional space, but in a (considering d>=2), which significantly increases the feature dimension but does not incur additional computational overhead in a single layer. After L star operations, we can implicitly obtain a For example, given a 10-layer network with a width of 128, the implicit feature dimension obtained by the star operation is about 901024, which can be reasonably approximated as infinite dimension. The star operation can significantly amplify the implicit dimension exponentially.
[0032] Furthermore, since the StarNet module maps input data to a high-dimensional space, in order to better adjust the learning rate during model training and speed up convergence, the SGD with Momentum (stochastic gradient descent with momentum) optimizer, which performs better in high-dimensional space, is selected to accelerate convergence and reduce oscillation. The SGD optimizer updates parameters through gradients at each iteration, but the direction of the gradient may vary greatly in different batches, resulting in large fluctuations in the direction of parameter updates, especially when the loss function surface is flat or close to local extreme points. This fluctuation will make the convergence process very slow. Therefore, the momentum method is introduced to reduce the noise in the gradient direction and speed up convergence by introducing historical gradient accumulation and combining the gradients of the previous few time steps.
[0033] The momentum method adds the exponential weighted average of the gradient to the SGD optimizer. The calculation formula is: in, is the cumulative value of momentum, indicating the accumulation of current and past gradients, is the momentum factor, is the current gradient, is the number of steps in the current iteration.
[0034] The calculation formula for parameter update is: in, is the learning rate, is the current parameter of the model.
[0035] In the above formula, the learning rate needs to be adjusted and momentum factor The two parameters were finally set with the learning rate set to 0.0045 and the momentum factor set to 0.999 as the parameter settings for the model to achieve the best effect.
[0036] Then, see Figure 3 , based on the improved AKConv-Yolov8 algorithm, metal corrosion detection is performed on the segmented area of the segmented image. Specifically, the improved AKConv-Yolov8 algorithm is used to process the input segmented image, and the metal area with the possibility of corrosion is detected and framed by the detection frame, and the position and category information of each detected metal area is obtained to generate an image with annotations. The metal area in the annotated image is cropped to obtain multiple image blocks. The multiple image blocks are processed for corrosion in turn, and the features of the rusted area in each image block, including the rusted area and the rusted position, are determined to determine whether the conductive lead is rusted.
[0037] Among them, the improved AKConv-Yolov8 algorithm model includes a backbone network, a neck network, and a head network. It adopts an anchor-free mechanism and introduces AKConv's new convolution operation in the Yolov8 model. It replaces part or all of the conv convolution operations in the original Yolov8 model with AKConv, and can dynamically adjust the convolution kernel according to the features of the input image to improve the flexibility of feature extraction. AKConv has the following advantages: adaptive kernel parameters. In AKConv, the parameters of the convolution kernel are dynamically adjusted, allowing the convolution kernel weights at each position to be learned and adjusted during training to adapt to the features at different positions; position-sensitive features. AKConv allows different convolution kernels to be used at different positions. This position-sensitive feature can better capture the feature information at different positions in the image, which helps to improve the model's expressiveness and performance.
[0038] Specifically, the AKConv calculation process: given feature map X, convolution kernel parameters W, bias b, output feature map Y, and adaptive convolution kernel weights And bias β, calculated as follows: in, is the number of input channels, is the first input feature map channels, is the convolution kernel channels.
[0039] The main principle is: traditional convolution operations usually use fixed-size convolution kernels, which limits its effectiveness in processing targets of different sizes and shapes. AKConv's initial sampling coordinate algorithm aims to solve this problem by allowing the convolution kernel to adapt to targets of different sizes, enhancing its flexibility and effectiveness. It can dynamically generate the initial sampling coordinates of the convolution kernel according to the size and shape of the target. This dynamic generation method enables the convolution kernel to cover and process different areas in the image more accurately, thereby improving the accuracy of feature extraction.
[0040] Here’s how it works: For each convolution operation, the algorithm first considers the size of the target. Based on this information, it generates a set of initial coordinates that define where the convolution kernel will sample. The generated initial coordinates are not fixed, but can be dynamically adjusted based on the features in the image. This means that the convolution kernel can change its sampling strategy based on the image content, thereby extracting features more effectively. As a result, AKConv can achieve more accurate feature extraction for both large and small targets.
[0041] The working process is as follows: extract the initial feature map from the input image. This step usually uses standard convolutional layers and pooling layers. A set of adaptive convolution kernels are generated based on the initial feature map through a specially designed small network (kernel generation network). This network can be a lightweight CNN, which is responsible for learning how to adjust the convolution kernel according to the input features. The generated convolution kernel is used to perform a convolution operation on the initial feature map to obtain the final feature map. This step can be regarded as an extension of traditional convolution, and the size and shape of the convolution kernel are dynamically changed in each convolution operation. Because AKConv's adaptive convolution kernel can extract important features more accurately, especially in complex backgrounds or occlusions, the quality of feature representation is improved.
[0042] Furthermore, the adjustment of hyperparameters is very important to fully utilize the potential of the AKConv-Yolov8 algorithm model. Since AKConv introduces additional dynamic convolution kernel updates, the learning rate needs to be appropriately reduced. When the learning rate is set to 0.00055, the training is relatively stable. In addition, the adaptive learning rate adjustment algorithm AdamW is used to improve the generalization ability of the model. Its formula is: in, is the weight attenuation coefficient, set to 0.888, is the momentum coefficient, set to 0.995, so that the gradient is more stable during training after the introduction of dynamic convolution. Since AKConv increases the computational complexity, the batch size is appropriately reduced. The core parameters of AKConv itself, the convolution kernel size and the dynamic adjustment coefficient, in order to reduce the computational overhead and adapt to small target detection, the shallow convolution kernel uses a size of 3×3, a dynamic adjustment coefficient of 0.6, and the deep convolution kernel uses a size of 7×7, and a dynamic adjustment coefficient of 0.2.
[0043] The core parameters of AKConv itself, the convolution kernel size and the dynamic adjustment coefficient, in order to reduce the computational overhead and adapt to small target detection, the shallow convolution kernel uses a size of 3×3, a dynamic adjustment coefficient of 0.6, and the deep convolution kernel uses a size of 7×7, with a dynamic adjustment coefficient of 0.2.
[0044] Furthermore, the other parameters of the AKConv-Yolov8 algorithm are set as follows: adjust the input size, keep the original image aspect ratio, and set the input image resolution imgsz to 416. Adjust the anchor box and set the size of the detection box anchor_scale to 2.2 to accommodate small targets. Adjust the Iou threshold to reduce the matching degree between the predicted box and the true box, set it to 0.45, thereby improving the recall rate of small targets. Increase the weights of positive and negative samples, set the classification loss cls_pw to 1.3, and set the target loss weight obj_pw to 1.45 to improve the model's classification and positioning of small targets. Enable data augmentation, enable more random cropping, scaling, rotation, and color conversion, etc., set random cropping to 0.1, scaling to 0.3, rotation to 20, upside down flip to 0.5, left-right flip to 0.5, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636. Increase the training rounds of the model, extend the training rounds, and set it to 600. Through the above parameter settings, the performance of detecting small targets of metal corrosion of conductive leads is effectively improved, which is 4.23% higher than the original default values.
[0045] In summary, in this embodiment, the introduction of AKConv's adaptive convolution makes the model more flexible when dealing with targets of different shapes and scales, thereby significantly improving the detection accuracy. Especially in complex scenes, AKConv-Yolov8 can more effectively identify and locate targets. Since AKConv can dynamically adjust the convolution kernel according to the input image, the model is more stable and robust when dealing with complex situations such as different backgrounds, illumination and occlusion. Despite the introduction of the calculation process of the dynamic convolution kernel, the design of AKConv is relatively efficient. Combined with the fast detection characteristics of Yolov8 itself, AKConv-Yolov8 can still maintain a high detection speed while further improving the detection quality. Traditional convolution kernels may not be accurate enough when dealing with small targets, and the adaptive characteristics of AKConv enable the convolution kernel to be reduced as needed, thereby more accurately detecting and locating small targets. AKConv's adaptive mechanism enables the model to better adapt to different detection tasks and data sets, without the need to manually adjust the convolution kernel, simplifying the model design and optimization process.
[0046] Finally, after completing multiple rounds of analysis and instructing the detection system to complete image collection, the AI platform finally obtains effective conductive lead metal corrosion information and gives it to the detection system. The detection system can receive the analyzed conductive lead metal corrosion information, which includes the detection frame position information and detection category information.
[0047] Preferably, the present embodiment also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the conductive lead metal corrosion detection method based on image recognition as described above.
[0048] Furthermore, the present embodiment also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the conductive lead metal corrosion detection method as described above.
[0049] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they still fall within the protection scope of the present invention.
Claims
1. A conductive lead metal corrosion detection method based on image recognition, characterized in that: The steps include: Shoot in the direction of the target object to be detected, obtain the corresponding scene image, and obtain image data; The image data is segmented using the improved StarNet-Yolov8 algorithm to obtain the segmented image of the target object to be detected; Based on the improved AKConv-Yolov8 algorithm, metal corrosion detection is performed on the segmented area of the segmented image, and the corresponding conductive lead metal corrosion detection results are generated; After repeating the above steps for several rounds, effective metal corrosion information of the conductive lead is obtained; The improved StarNet-Yolov8 algorithm includes a backbone network, a neck network, and a head network. It adopts an anchor-free mechanism and replaces the backbone network of the Yolov8 model with a StarNet module to more efficiently extract and represent image features. The improved AKConv-Yolov8 algorithm includes a backbone network, a neck network and a head network. It adopts an anchor-free mechanism and introduces AKConv's new convolution operation into the Yolov8 model. At least one standard convolution layer in the original Yolov8 model is replaced by AKConv, and the convolution kernel is dynamically adjusted according to the features of the input image to improve the flexibility of feature extraction.
2. The conductive lead metal corrosion detection method based on image recognition according to claim 1, characterized in that: The obtaining of image data specifically includes: calling the camera to turn to the position of the target object to be detected and recording the position coordinates; starting image shooting, obtaining image data, and sending the image data, callback interface and AI parameters to the AI platform to perform image segmentation and metal corrosion detection.
3. The conductive lead metal corrosion detection method based on image recognition according to claim 1, characterized in that: The segmentation of the image data using the improved StarNet-Yolov8 algorithm is specifically as follows: decoding the picture data, scaling and standardizing the preprocessing to generate a set of image data; sending the image data to the improved StarNet-Yolov8 algorithm for processing, segmenting the pixel area of the conductive lead position that needs to be paid attention to in the image data from the background pixel area, and assigning a semantic label associated with the conductive lead to it.
4. The conductive lead metal corrosion detection method based on image recognition according to claim 3 is characterized in that: Since the StarNet module maps input data to a high-dimensional space, the SGD optimizer is used in the StarNet-Yolov8 algorithm to adjust the learning rate during model training. The SGD optimizer is combined with the momentum method to prevent fluctuations in parameter updates during SGD optimizer iterations. The momentum method adds the exponential weighted average of the gradient to the SGD optimizer. The calculation formula is: in, is the cumulative value of momentum, indicating the accumulation of current and past gradients, is the momentum factor, is the current gradient, is the number of steps of the current iteration; The calculation formula for parameter update is: in, is the learning rate, is the current parameter of the model.
5. The conductive lead metal corrosion detection method based on image recognition according to claim 1, characterized in that: The metal corrosion detection of the segmented area of the segmented image based on the improved AKConv-Yolov8 algorithm is specifically as follows: the input segmented image is processed by the improved AKConv-Yolov8 algorithm, the metal area with the possibility of corrosion is detected and framed by the detection frame, the position and category information of each detected metal area is obtained, and an image with annotations is generated; The metal area in the annotated image is cropped to obtain multiple image blocks; the multiple image blocks are processed for rust in turn, and the features of the rusted area in each image block, including the rusted area and the rusted position, are determined to determine whether the conductive lead is rusted.
6. The conductive lead metal corrosion detection method based on image recognition according to claim 5, characterized in that: The parameter settings in the AKConv-Yolov8 algorithm are as follows: while keeping the original image aspect ratio, set the input image resolution imgsz to 416; set the size of the detection box anchor_scale=2.2; adjust the Iou threshold to 0.45; set the classification loss cls_pw to 1.3, and the target loss weight obj_pw to 1.45; enable data enhancement, set random cropping to 0.1, scaling to 0.3, rotation to 20, upside down flipping to 0.5, left-right flipping to 0.5, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636; and set the extension round to 600.
7. The conductive lead metal corrosion detection method based on image recognition according to claim 5, characterized in that: In the AKConv-Yolov8 algorithm, the adaptive learning rate adjustment algorithm AdamW is used to improve the generalization ability of the model. The formula is: in, is the weight attenuation coefficient, set to 0.888, is the momentum coefficient, set to 0.995, represents the bias-corrected first-order momentum estimate, represents the bias-corrected second-order momentum estimate, =1e−8, ϵ is a minimum value to prevent division by zero.
8. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the conductive lead metal corrosion detection method based on image recognition as described in any one of claims 1 to 7.
9. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors execute the conductive lead metal corrosion detection method based on image recognition as described in any one of claims 1 to 7.