Conductive joint metal corrosion detection method based on image recognition
Through image recognition-based detection methods, the improved SimAM-Yolov8 and GSconv-Yolov8 algorithms are used to solve the problems of low efficiency and poor accuracy of traditional manual inspection, and the efficient and accurate results of metal corrosion detection of conductive joints are achieved.
Patent Information
- Application Number
- CN202411445033.7
- 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
The metal corrosion detection of traditional conductive joints relies on manual inspection, which is inefficient and susceptible to subjective factors, making it difficult to ensure the accuracy of the inspection, which may lead to missed inspection or missed inspection.
Using image recognition-based detection methods, the improved SimAM-Yolov8 and GSconv-Yolov8 algorithms are used to capture conductive joints through the camera, image segmentation and metal rust detection are performed, combined with the lightweight attention mechanism SimAM and the new convolution operation GSConv. Improve feature representation and detection accuracy.
It improves the accuracy and efficiency of metal corrosion detection of conductive joints, and can provide higher real-time and accuracy without increasing calculation overhead, significantly improving the reliability and accuracy of detection results.
Smart Images

Figure CN119313644A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of power equipment monitoring, and in particular relates to a conductive joint metal corrosion detection method based on image recognition. Background Art
[0002] In the traditional power industry, metal corrosion detection of conductive joints is a crucial area. Conductive joints 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 joints, which may lead to increased contact resistance, decreased transmission capacity, and even fire and other serious consequences.
[0003] Traditional detection of metal corrosion in conductive joints 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 inspection cannot ensure that every joint can be carefully inspected, and may lead to missed inspections or mis-inspections. Summary of the invention
[0005] The technical purpose of the present invention is to provide a method for detecting metal corrosion of conductive joints based on image recognition, so as to solve the problem that there are various limitations in manual inspection of conductive joint corrosion.
[0006] To solve the above problems, the technical solution of the present invention is: A method for detecting metal corrosion of conductive joints 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 SimAM-Yolov8 algorithm to obtain a segmented image that segments the target object to be detected; Based on the improved GSconv-Yolov8 algorithm, metal corrosion detection is performed on the segmented image, and the corresponding conductive joint metal corrosion detection results are generated; After repeating the above steps for several rounds, effective metal corrosion information of the conductive joint is obtained; The improved SimAM-Yolov8 algorithm includes a backbone network, a neck network, a head network, and an anchor-free mechanism. A lightweight attention mechanism SimAM is introduced into the Yolov8 model to enhance the quality of feature representation by simulating the attention mechanism. The improved GSconv-Yolov8 algorithm includes a backbone network, a neck network, a head network and an anchor-free mechanism, and introduces a new convolution operation of GSConv into the Yolov8 model. GSConv is inserted into various feature extraction and fusion modules in the Yolov8 model to improve the quality of feature representation.
[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] Among them, the image data is segmented using the improved SimAM-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 SimAM-Yolov8 algorithm for processing, the pixel area of the conductive joint position that needs to be paid attention to in the image data is segmented from the background pixel area, and the semantic label associated with the conductive joint is assigned to it.
[0009] Specifically, the Adam algorithm is used in the SimAM-Yolov8 algorithm to adaptively optimize the learning rate. The learning rate of each parameter is adjusted by calculating the first-order moment estimate and the second-order moment estimate of the gradient. The calculation formulas are: in, is the current gradient, are the attenuation coefficients, which are set to 0.8 and 0.95 respectively; When the initial values of the first-order moment estimate and the second-order moment estimate are 0, the deviation is large and needs to be corrected. The formulas for correcting the initial deviation are: The parameter formula of the Adam algorithm is as follows: in, is the current parameter, is the learning rate, set to 0.0005, is a small constant.
[0010] Among them, the metal corrosion detection of the segmented image based on the improved GSconv-Yolov8 algorithm is specifically as follows: the input segmented image is processed by the improved GSconv-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 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 joint is rusted.
[0011] Specifically, the parameters of the GSconv-Yolov8 algorithm are set as follows: The resolution of the input segmented image is set to 640; the initial detection box size is set, anchor_scale=2.5; the large model is selected to increase the receptive field, and the network depth depth_multiple is adjusted to 0.5; the matching degree between the predicted box and the true box is reduced, and the Iou threshold is set to 0.4; the weights of positive and negative samples are increased, and the classification loss cls_pw=1.2 and the target loss weight obj_pw=1.5 are set; data enhancement is enabled, and random cropping is set to 0.3, scaling is set to 0.5, rotation is set to 30, upside down flip is set to 0.7, left-right flip is set to 0.7, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636; initial learning rate lr0=0.00269, final learning rate lrf=0.00288, reduce weight decay weight_decay=0.00015; the extension round is set to 600.
[0012] 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 above-mentioned conductive joint metal corrosion detection method based on image recognition.
[0013] 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 joint metal corrosion detection method based on image recognition.
[0014] 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 can enhance feature representation and improve detection accuracy without significantly increasing computational overhead by introducing a lightweight attention mechanism SimAM into the Yolov8 model. This makes Yolov8 more outstanding in terms of real-time performance and accuracy. SimAM is a lightweight attention mechanism that aims to improve the quality of feature representation through simple operations. SimAM can improve the feature extraction and fusion process in Yolov8. It implements the attention mechanism through simple arithmetic operations (such as addition and multiplication) without significantly increasing computational overhead, and is suitable for application in real-time detection models such as Yolov8. SimAM can highlight more important features and suppress irrelevant or redundant information by adaptively adjusting the features of each channel, thereby improving the quality of feature representation. Since the feature representation is more refined and accurate, SimAM can help Yolov8 improve the accuracy of target detection, especially in complex scenes or occlusion situations.
[0015] The present invention also introduces a new convolution operation of GSConv in the Yolov8 algorithm. GSConv combines group convolution and channel shuffling technology to enhance the interaction between features, so that the model can better capture high-order features and detail information in the image, thereby improving the quality of feature extraction. Through channel shuffling, GSConv breaks the limitation of group convolution in the feature fusion process, ensures full interaction between different features, and improves the diversity and integrity of feature representation. The introduction of GSConv enables the model to perform better when processing complex backgrounds and high-dimensional features, significantly improving the accuracy and reliability of target detection. Despite the introduction of new convolution operations, GSConv has a low computational cost and will not significantly increase the computational overhead of the model, maintaining the efficient real-time detection capability of Yolov8. The GSConv-Yolov8 algorithm model can show stronger performance advantages in various complex scenarios, such as real-time detection and high-precision offline processing tasks, and provide more accurate and reliable conductive joint metal corrosion detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1 It is a flow chart of a conductive joint metal corrosion detection method based on image recognition of the present invention; Figure 2 This is the improved SimAM-Yolov8 algorithm architecture diagram of the present invention; Figure 3It is the GSConv structure diagram in the improved GSConv-Yolov8 algorithm of the present invention; Figure 4 This is the improved GSConv-Yolov8 algorithm architecture diagram of the present invention. DETAILED DESCRIPTION
[0018] 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.
[0019] 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".
[0020] The following is a further detailed description of a conductive joint 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.
[0021] See also Figures 1 to 4 This embodiment provides a conductive joint metal corrosion detection method based on image recognition, which specifically includes 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.
[0022] Then, the AI platform uses the improved SimAM-Yolov8 algorithm to segment the received image data, thereby segmenting the target to be detected and obtaining a segmented image. The specific steps are: decoding the image data, scaling and standardizing the preprocessing to generate a set of image data. The image data is sent to the improved SimAM-Yolov8 algorithm for processing, and the pixel area of the conductive joint position that needs to be paid attention to in the image data is segmented from the background pixel area, and the semantic label associated with the conductive joint is assigned to it.
[0023] See also Figure 2In the original Yolov8 algorithm, feature extraction and fusion mainly rely on traditional convolution operations. Although these operations perform well in terms of efficiency and computational cost, they still have certain deficiencies in the quality of feature extraction and fusion. The limitation of traditional convolution operations is that they cannot fully capture the complex relationship between features, especially when dealing with complex backgrounds and images with rich details, the detection accuracy may be affected. Therefore, in order to overcome the above limitations, this implementation introduces technical improvements such as SimAM (Simulated Attention Mechanism) module, anchor-free mechanism (Anchor-Free) and multi-scale feature fusion in SimAM-Yolov8 (a deep learning algorithm model suitable for real-time target detection tasks), which can better enhance the quality of feature representation and improve the accuracy and efficiency of target detection. The improved SimAM-Yolov8 algorithm consists of a backbone network (backbone), a neck network (neck), and a head network (head). Among them, 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.
[0024] In order to achieve the best detection effect, the hyperparameters of the SimAM-Yolov8 algorithm model need to be adjusted. The size of the model input image is adjusted to 1080, and the aspect ratio of the image is maintained. The anchor boxes are re-clustered to adapt to the target size, and the medium model is used for detection. Iou is set to 0.7 to improve the accuracy of the first-stage region positioning. Mosaic data enhancement is enabled throughout the process, and the detection effect of the model is improved by adjusting the relevant parameters.
[0025] Among them, the SimAM module can be understood as an improvement point of the algorithm model, which is combined with the C2f module connected to Dectect in the neck network. By simulating the attention mechanism, the weights of the feature map are dynamically adjusted without significantly increasing the computational overhead, important features are strengthened, and irrelevant features are suppressed, thereby improving the detection accuracy. In the SimAM module, in order to evaluate the importance of each neuron, neurons with spatial suppression effects should be given higher importance. The simplest way to find important neurons is to measure the linear separability between neurons. Define the following energy function: Solving this formula for minimum energy yields: The above formula means that the lower the energy, the greater the difference between neuron t and surrounding neurons, and the higher the importance. Therefore, the importance of a neuron can be expressed by 1 / get.
[0026] Preferably, the Adam algorithm is also used in the SimAM-Yolov8 algorithm to adaptively optimize the learning rate, and the learning rate of each parameter is adjusted by calculating the first-order moment estimate (mean) and second-order moment estimate (variance) of the gradient to accelerate the convergence speed. The Adam algorithm uses exponentially weighted moving average to estimate the mean and variance of the gradient, so the update calculation formulas for the first-order and second-order moment estimates are: in, is the current gradient, are the attenuation coefficients, which are set to 0.8 and 0.95 respectively.
[0027] When the initial values of the first-order moment estimate and the second-order moment estimate are 0, the deviation is large and needs to be corrected. The formulas for correcting the initial deviation are: The parameter update formula of the Adam algorithm is as follows: in, is the current parameter, is the learning rate, set to 0.0005, is a small constant.
[0028] In summary, the improved SimAM-Yolov8 network successfully makes up for the shortcomings of traditional Yolov8 in feature extraction and fusion quality by introducing SimAM, a lightweight attention mechanism, significantly improves the detection accuracy, and maintains the real-time performance of the model, making it perform better in various application scenarios.
[0029] Then, see Figure 3 and Figure 4 ,After the segmentation is completed, the metal corrosion detection is performed on the ,segmented image based on the improved GSconv-Yolov8 algorithm and the ,corresponding conductive joint metal corrosion detection results are generated.
[0030] Specifically, the input segmented image is processed using the improved GSconv-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 to generate an image with annotations. The metal area in the annotated image is cropped to obtain multiple image blocks. Then, 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 used to determine whether the conductive joint is corroded. Among them, the improved GSconv-Yolov8 algorithm also includes a backbone network (backbone), a neck network (neck) and a head network (head), and adopts an anchor-free mechanism.
[0031] Specifically, the parameters of the GSconv-Yolov8 algorithm model are set as follows: adjust the input size, and set the resolution of the input segmented image to 640. Set the initial detection box size, and calculate the box suitable for small targets. Set anchor_scale=2.5 to adapt to small targets. Increase the model receptive field, select the large model to increase the receptive field, and adjust the network depth depth_multiple to 0.5 so that the model has a larger receptive field to capture the global features of small targets. Adjust the Iou threshold to reduce the matching degree between the predicted box and the true box, and set the Iou threshold to 0.4 to improve the recall rate of small targets. Increase the weights of positive and negative samples, set the classification loss cls_pw=1.2 and the target loss weight obj_pw=1.5, and improve the model's classification and positioning of small targets. Enable more data augmentation, set random cropping to 0.3, scaling to 0.5, rotation to 30, upside down flip to 0.7, left-right flip to 0.7, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636. Increase the learning rate, set the initial learning rate lr0=0.00269, the final learning rate lrf=0.00288, and reduce the weight decay weight_decay=0.00015 to avoid excessive punishment of small target features. Increase the number of training rounds, extend the rounds, and set it to 600. With the above parameter settings, the performance of small target detection of metal corrosion of conductive joints is effectively improved, which is 2.88% higher than the original default value.
[0032] In the original Yolov8 algorithm, feature extraction and fusion mainly rely on traditional convolution operations. Although traditional convolution performs well in computational efficiency and speed, it still has certain deficiencies in the quality of feature extraction and fusion. In particular, when processing high-dimensional feature space and complex background, traditional convolution may not be able to fully capture the high-order relationship between features, resulting in insufficient detection accuracy. Therefore, in this embodiment, a new convolution of GSConv is introduced in the Yolov8 model, and GSconv replaces the standard conv convolution, that is, GSConv is inserted into each feature extraction and fusion module in the Yolov8 model, thereby improving the quality of feature representation. GSconv is a convolution operation that mixes SC (channel dense convolution operation), DSC (depth separable convolution) and shuffle. Shuffle is used to infiltrate the information generated by SC (channel dense convolution operation) into all parts of all information generated by DSC (depth separable convolution). Shuffling is a uniform mixing strategy that allows the information of SC to be fully mixed into the output of DSC by uniformly exchanging local feature information on different channels without cumbersome steps. Specifically: GSConv first divides the input image into several groups, and then performs convolution operations within each group. Unlike traditional group convolution, GSConv remixes the features of different groups by shuffling channels after completing group convolution. This process ensures that the features between groups can fully interact, thereby capturing richer feature representations. That is, standard convolution is performed on the input, followed by deep convolution, the results of the two convolutions are concatenated, and finally shuffled.
[0033] In summary, the introduction of GSConv enhances feature extraction capabilities: Through GSConv, the model can better capture the details and high-order feature relationships in the image, improving the quality of feature extraction. Optimize the feature fusion process: During the feature fusion process, GSConv enhances the interaction between different features through channel shuffling, ensuring the diversity and integrity of feature representation. Reduce computational overhead: Although a new convolution operation is introduced, the design of GSConv does not significantly increase the computational overhead, maintaining the efficiency of the model.
[0034] Compared with GSConv, in order to accelerate the calculation of prediction, the feed image in the traditional CNN must almost undergo a similar conversion process in the backbone network: spatial information is gradually transmitted to the channel, and each time the spatial (width and height) compression and channel expansion of the feature map will cause partial loss of semantic information. The dense convolution calculation of this embodiment can maximize the retention of hidden connections between each channel, while the sparse convolution completely cuts off these connections.
[0035] Optimally, GSConv needs to retain the original connections as much as possible, but if it is used in all stages of the model, the network layer of the model will become deeper, and the deep layer will increase the resistance to data flow and significantly increase the inference time. When these feature maps reach the neck network, the data has become slender (the channel dimension reaches the maximum, and the width and height dimensions reach the minimum), and no transformation is required. Therefore, a better choice is to use GSConv only in the neck network (Slim-Neck + standard Backbone). At this stage, using GSConv to process concatenated feature maps can achieve less redundant and repeated information, no compression is required, and the attention module works better.
[0036] Finally, after repeating the above steps of collection, segmentation and detection for several rounds, effective conductive joint metal corrosion information is finally obtained and given to the detection system. The detection system receives the analyzed conductive joint metal corrosion information, and the data contains the detection frame position information and detection category information. 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 joint metal corrosion detection method based on image recognition as described above.
[0037] Preferably, the present embodiment also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the conductive joint metal corrosion detection method based on image recognition as described above.
[0038] 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 method for detecting metal corrosion of conductive joints 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 SimAM-Yolov8 algorithm to obtain a segmented image that segments the target object to be detected; Based on the improved GSconv-Yolov8 algorithm, metal corrosion detection is performed on the segmented image, and the corresponding conductive joint metal corrosion detection results are generated; After repeating the above steps for several rounds, effective metal corrosion information of the conductive joint is obtained; The improved SimAM-Yolov8 algorithm includes a backbone network, a neck network, a head network, and an anchor-free mechanism. A lightweight attention mechanism SimAM is introduced into the Yolov8 model to enhance the quality of feature representation by simulating the attention mechanism. The improved GSconv-Yolov8 algorithm includes a backbone network, a neck network, a head network and an anchor-free mechanism, and introduces a new convolution operation of GSConv into the Yolov8 model. GSConv is inserted into various feature extraction and fusion modules in the Yolov8 model to improve the quality of feature representation.
2. The conductive joint metal corrosion detection method based on image recognition according to claim 1 is 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 joint metal corrosion detection method based on image recognition according to claim 1 is characterized in that: The method of segmenting the image data using the improved SimAM-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 SimAM-Yolov8 algorithm for processing, segmenting the pixel area of the conductive joint position that needs to be paid attention to in the image data from the background pixel area, and assigning it a semantic label associated with the conductive joint.
4. The conductive joint metal corrosion detection method based on image recognition according to claim 3 is characterized in that: In the SimAM-Yolov8 algorithm, the Adam algorithm is used to adaptively optimize the learning rate. The learning rate of each parameter is adjusted by calculating the first-order moment estimate and the second-order moment estimate of the gradient. The calculation formulas are: in, is the current gradient, are the attenuation coefficients, which are set to 0.8 and 0.95 respectively; When the initial values of the first-order moment estimate and the second-order moment estimate are 0, the deviation is large and needs to be corrected. The formulas for correcting the initial deviation are: The parameter formula of the Adam algorithm is as follows: in, is the current parameter, is the learning rate, set to 0.0005, is a small constant.
5. The conductive joint metal corrosion detection method based on image recognition according to claim 1 is characterized in that: The metal corrosion detection based on the improved GSconv-Yolov8 algorithm on the segmented image is specifically as follows: the input segmented image is processed by the improved GSconv-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 joint is rusted.
6. The conductive joint metal corrosion detection method based on image recognition according to claim 5 is characterized in that: The parameter settings of the GSconv-Yolov8 algorithm are as follows: The resolution of the input segmented image is set to 640; the initial detection box size is set, anchor_scale=2.5; the large model is selected to increase the receptive field, and the network depth depth_multiple is adjusted to 0.5; the matching degree between the predicted box and the true box is reduced, and the Iou threshold is set to 0.4; the weights of positive and negative samples are increased, and the classification loss cls_pw=1.2 and the target loss weight obj_pw=1.5 are set; data enhancement is enabled, and random cropping is set to 0.3, scaling is set to 0.5, rotation is set to 30, upside down flip is set to 0.7, left-right flip is set to 0.7, color conversion hsv_h=0.011148, hsv_s=0.53554, hsv_v=0.13636; initial learning rate lr0=0.00269, final learning rate lrf=0.00288, reduce weight decay weight_decay=0.00015; the extension round is set to 600.
7. 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 joint metal corrosion detection method based on image recognition as described in any one of claims 1 to 6.
8. 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 joint metal corrosion detection method based on image recognition as described in any one of claims 1 to 6.