Illumination-adaptive steel tower welding seam image defect identification method and system

By combining dynamic correction weight calculation and block illumination weighting mechanism with YOLOv8 model, the anchor frame size and confidence threshold are dynamically adjusted, which solves the problem of insufficient accuracy of steel tower weld defect recognition in complex outdoor lighting environments. This enables real-time and accurate detection of weld defects.

CN121685463AInactive Publication Date: 2026-03-17ANHUI XIRUN HUADA NEW ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional methods lack sufficient accuracy and stability in identifying defects in steel tower weld images under complex outdoor lighting conditions, failing to meet the high requirements of wind power equipment for real-time and accurate detection of weld defects.

Method used

An illumination-adaptive defect recognition method for steel tower weld images is adopted. By using a dynamic correction weight calculation module and a weld block illumination weighting mechanism, combined with the YOLOv8 model, the anchor frame size and confidence threshold are dynamically adjusted to generate a detection model adapted to the current illumination scene.

Benefits of technology

It improves the accuracy and stability of weld defect identification, solves the problems of insufficient accuracy and poor stability of traditional methods in complex outdoor lighting environments, and realizes real-time and accurate detection of weld defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685463A_ABST
    Figure CN121685463A_ABST
Patent Text Reader

Abstract

The invention discloses an illumination self-adaptive steel tower welding seam image defect identification method and system. The method comprises the following steps: A1, acquiring and preprocessing an original steel tower welding seam image and an environment illumination value; a2, calculating an illumination correction weight and an illumination correction coefficient; calculating an illumination perception attention weight, and generating a welding seam image after illumination correction; a3, calculating block correction weights, generating a local refined correction weld seam image, and reinforcing defect texture features to obtain a final weld seam correction image; a4, extracting illumination-image fusion features, and sequentially calculating the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of YOLOv8; a5, a YOLOv8 model is configured; a6, defect recognition is conducted on the final weld joint correction image, and a weld joint defect recognition result is obtained; according to the invention, the problem of insufficient steel tower welding seam image defect identification precision caused by outdoor illumination intensity change in a traditional method can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of steel tower weld recognition technology, and in particular to a method and system for identifying defects in steel tower weld images that is adaptive to illumination. Background Technology

[0002] As the core support structure for power transmission, communication security, and wind turbine generators, steel towers are crucial load-bearing components of wind power systems. They must withstand the vibration loads, strong wind impacts, and diurnal temperature variations generated by the operation of the generators over long periods. The structural integrity of the welds directly affects the operational safety and service life of the wind power equipment. If defects such as cracks, porosity, or incomplete penetration occur in the welds, it may lead to structural instability of the steel tower, resulting in generator shutdown or even major safety accidents.

[0003] The core of the weld defect recognition technology for wind turbine steel towers lies in accurately identifying various weld defects by acquiring images of the steel tower welds and then performing image preprocessing, feature extraction, and target detection. In the early stages of weld defect recognition technology, traditional methods relied heavily on manual visual inspection combined with simple image processing algorithms. For wind turbine steel towers, manual inspection required the use of high-altitude work equipment, which was not only extremely inefficient and risky, but also subject to subjective factors such as the experience and fatigue of the inspectors, resulting in significantly higher rates of missed and false detections compared to ground-based steel tower inspection. Traditional image processing algorithms, such as threshold segmentation, edge detection, and morphological processing, processed weld images by setting fixed grayscale thresholds and edge extraction operators. While these methods could replace some manual operations to a certain extent, they were subject to stringent lighting conditions. Wind turbine steel towers are often deployed in open outdoor areas such as plateaus, coastlines, and grasslands, where light intensity fluctuates dramatically depending on weather and time of day. Under strong sunlight, weld images are prone to local overexposure and loss of detail, while shadows cause a sharp drop in image contrast. This imbalance in grayscale distribution can easily cause traditional algorithms to fail in feature extraction.

[0004] With the rapid rise of deep learning technology in the field of computer vision, weld image defect recognition is gradually shifting towards deep learning-based solutions. Existing technologies often use convolutional neural networks for automatic extraction and classification of weld defect features. Target detection models such as the YOLO series and Faster R-CNN are also applied to weld area localization. However, their adaptability to wind turbine steel tower scenarios remains significantly insufficient: most models are trained on standard indoor datasets with uniform illumination, without incorporating data from extreme lighting scenarios such as strong ultraviolet radiation, sudden strong winds causing light and shadow fluctuations, and the switching between weak and strong light during day and night. When the actual weld images collected change due to these random lighting variations, the model struggles to extract effective defect features, resulting in a significant drop in recognition accuracy. Furthermore, traditional methods do not deeply integrate the illumination correction module with the target detection model. The corrected images still struggle to adapt to the input requirements of subsequent detection models, ultimately leading to poor stability of the recognition system during outdoor inspections of wind turbine steel towers. This fails to meet the high requirements of wind power equipment for real-time and accurate detection of weld defects, severely restricting the efficiency and safety assurance capabilities of wind power operation and maintenance. Summary of the Invention

[0005] In view of this, the present invention aims to provide a light-adaptive method and system for identifying defects in steel tower weld images, in order to solve the problem of insufficient accuracy in identifying defects in steel tower weld images caused by changes in outdoor light intensity in traditional methods.

[0006] A method for identifying defects in steel tower weld images with adaptive illumination, comprising:

[0007] A1: Collect the original image of the steel tower weld and the ambient illuminance value, and perform preprocessing to obtain the preprocessed weld image and the preprocessed ambient illuminance value;

[0008] A2: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the illumination correction weight and illumination correction coefficient are calculated through the dynamic correction weight calculation module; then the illumination perception attention weight is calculated, and the illumination-corrected weld image is generated.

[0009] A3: For the weld image after illumination correction, the block correction weight is calculated through the weld block illumination weighting mechanism, and a locally refined corrected weld image is generated. Then, the defect texture features are enhanced to obtain the final corrected weld image.

[0010] A4: Based on the final weld seam correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features, and sequentially calculate the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of YOLOv8; A5: Use the dynamically adjusted anchor frame size as the anchor frame configuration parameter of the YOLOv8 model, and the dynamically adjusted confidence threshold as the detection judgment threshold parameter of the YOLOv8 model, integrate them to form a YOLOv8 core parameter group that matches the current steel tower weld seam detection scenario, and then assign the YOLOv8 core parameter group to the corresponding parameter configuration item of the YOLOv8 basic model to obtain the configured YOLOv8 model;

[0011] A6: Based on the configured YOLOv8 model, perform defect identification on the final weld correction image to obtain the weld defect identification result;

[0012] Furthermore, step A1 also includes:

[0013] A11: Acquires original images of the steel tower weld seams of the wind turbine generator set using an industrial-grade camera; the data type is two-dimensional RGB image data. Simultaneously, acquires ambient illuminance values ​​synchronized with the original images of the steel tower weld seams using a light sensor; the data type is numerical data.

[0014] A12: Gaussian filtering is used to denoise the original image of the steel tower weld to obtain a denoised weld image. Then, linear interpolation is used to unify the resolution of the denoised weld image to obtain a cleaned weld image.

[0015] A13: Linear normalization is applied to the cleaned weld image to map the pixel values ​​of the RGB channels of the image from the original 0-255 range to the 0-1 range, thus obtaining the preprocessed weld image.

[0016] A14: Normalize the ambient illuminance values ​​to obtain the preprocessed ambient illuminance values.

[0017] Furthermore, step A2 also includes:

[0018] A21: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the illumination correction weight and illumination correction coefficient are calculated using the dynamic correction weight calculation module. The calculation method is as follows:

[0019]

[0020]

[0021] in, For illumination correction weights, For the Sigmoid function, It is a multilayer perceptron. For splicing operations, Calculated for the mean. This is a pre-processed image of the weld. This represents the pre-processed ambient illuminance value. This is the illumination correction factor. For Hadama accumulation, Calculate operators for image gradients;

[0022] A22: Based on the illumination correction coefficient and the preprocessed weld image, calculate the illumination perception attention weights and generate an illumination-corrected weld image. The calculation method is as follows:

[0023]

[0024]

[0025]

[0026]

[0027]

[0028] in, As a feature of the illumination, For residual blocks, It is a convolutional layer. For light perception attention weights, For the Softmax function, For the illumination component of the weld image, It is an exponential function. For the reflection component of the weld image, To avoid the minimum value where the denominator is 0, For skip connections, This is an image of the weld after illumination correction. It is a deconvolutional layer.

[0029] It should be further explained that steel towers are mostly deployed in open outdoor areas, where the ambient illuminance fluctuates drastically due to weather and time of day. This can cause problems such as local overexposure and shadows in the pre-processed weld images, resulting in loss of weld details and decreased contrast. Weld defect recognition has high requirements for the uniformity of illumination and feature integrity of the image. Traditional correction methods are difficult to adapt to this dynamically changing lighting environment and are prone to failure of subsequent defect feature extraction due to light interference.

[0030] To address the aforementioned issues, this invention first introduces a dynamic correction weight calculation module. It takes the pre-processed weld seam image and the pre-processed ambient illuminance value as input, and calculates the illumination correction weight and coefficient by fusing the features of both to adapt to the current light intensity. This provides a targeted adjustment basis for subsequent corrections, avoiding the problem that uniform correction parameters cannot adapt to different lighting scenarios. Next, the illumination correction coefficient is combined with the pre-processed weld seam image. Intermediate illumination features are extracted through residual blocks and convolutional layers, ensuring both the depth of feature extraction and preventing gradient vanishing through the residual structure. Simultaneously, the pre-processed ambient illuminance value is incorporated to calculate the illumination perception attention weight, allowing the correction process to focus on the light. In areas significantly affected by illumination, the accuracy of the correction is improved. Then, by separating the illumination component and the reflection component of the weld image, the illumination interference and the structural features of the weld itself are separated. The reflection component retains the core structure and potential defect information of the weld, while the illumination component specifically carries the illumination interference factors that need to be corrected. Finally, by using skip connections, the effective original features in the preprocessed weld image are preserved to avoid feature loss during the correction process. Then, the resolution and detail integrity of the image are restored through a deconvolution layer, which effectively offsets the interference such as overexposure and shadows caused by illumination fluctuations, while completely preserving the structural features and defect-related information of the weld, thus achieving illumination correction and feature protection.

[0031] In existing technologies, traditional image illumination correction often employs fixed threshold adjustments and edge enhancement algorithms, failing to deeply integrate ambient illumination information into the correction process. This makes these methods ill-suited for dynamically changing outdoor lighting scenarios, prone to losing key weld features during correction, and resulting in unstable correction effects. In contrast, the process of generating illumination-corrected weld images in this invention utilizes illumination-sensing attention weights to focus on the correction area. Through component separation, it achieves precise separation of illumination interference from weld features. This solves the problem of poor illumination adaptability in traditional methods and overcomes the shortcomings of insufficient feature protection in existing deep learning methods. The corrected image exhibits better illumination uniformity and higher weld feature integrity.

[0032] Furthermore, step A3 also includes:

[0033] A31: For the weld image after illumination correction, the block correction weight is calculated through a weld block illumination weighting mechanism, and a locally refined corrected weld image is generated. The calculation method of the weld block illumination weighting mechanism is as follows:

[0034]

[0035]

[0036] in, To correct the weights in blocks, For the Softmax function, It is a multilayer perceptron. For splicing operations, Calculated for the mean. To divide the image into segments of size 1 Non-overlapping block operations, It is a convolutional layer. The product is the Hadamard product, and k is the block index. This is an image of the weld after illumination correction. This is the illumination correction factor. To refine the local weld seam image, For residual blocks, For jump connections;

[0037] A32: Based on the locally refined weld image, the defect texture features are enhanced to obtain the final weld correction image. The calculation method is as follows:

[0038]

[0039]

[0040] in, For defect texture features, For attention mechanisms, For depthwise separable convolution, Calculate the operator for image gradient. For the Laplace operator, For Hadama accumulation, For the final weld correction image, Pixel rearrangement convolution, It is a residual dense block.

[0041] It should be further explained that after generating the weld image after illumination correction, there is still the problem of uneven local illumination caused by complex outdoor lighting. Some areas may have slight overexposure or weak shadows. Moreover, cracks, pores and other defects in the weld are mostly fine texture features, which are easily masked by residual illumination. At the same time, the defect features of the steel tower weld image are not much different from the background. If only overall illumination correction is performed, it is difficult to accurately solve the problem of local illumination imbalance, and it is also impossible to specifically enhance the defect texture, which can easily lead to insufficient feature extraction in the subsequent defect recognition process.

[0042] This invention first addresses the problem of uneven local illumination in weld seam images after illumination correction. A weld seam block illumination weighting mechanism divides the image into multiple local regions through block operations. Combining illumination correction coefficients, a multilayer perceptron and a Softmax function are used to calculate the correction weight for each block, ensuring that each local region receives targeted correction tailored to its specific illumination conditions, avoiding insufficient adaptation of local regions by the overall correction. Simultaneously, the combination of residual blocks and skip connections effectively preserves the original effective features in the illumination-corrected weld seam image during convolution processing of the block-corrected image, preventing feature distortion or loss during local correction. Subsequently, based on... The local fine-tuning of weld seam images extracts multi-dimensional features through depthwise separable convolution, fuses image gradients with edge information captured by the Laplacian operator, and then uses an attention mechanism to focus on defect-related features, suppressing irrelevant background interference to generate enhanced defect texture features. Finally, pixel rearrangement convolution restores the image detail resolution, and residual dense blocks are combined to densely fuse the multi-layer features of the locally fine-tuned weld seam images, further preserving weld seam structural information and enhanced defect texture features. This solves the problem of uneven local illumination affecting image quality and maximizes the highlighting of subtle defect texture features, providing a high-quality image foundation for subsequent defect recognition.

[0043] Furthermore, step A4 also includes:

[0044] The dynamically adjusted anchor frame size is based on the basic anchor frame size of YOLOv8, and is obtained by adaptively adjusting it in combination with illumination-image fusion features, pixel ratio features of defect areas, and preprocessed ambient illuminance values.

[0045] The dynamically adjusted confidence threshold is based on the YOLOv8 base confidence threshold and is adaptively adjusted by combining illumination-image fusion features, dynamically adjusted anchor frame size and weld edge sharpness features, and preprocessed ambient illuminance values.

[0046] Furthermore, step A4 also includes:

[0047] A41: Based on the final weld seam correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features. The calculation method is as follows:

[0048]

[0049]

[0050]

[0051] in, For the weld area mask, For the Canny edge detection operator, This is a pre-processed image of the weld. For threshold filtering operation, For the clarity characteristics of weld edges, The constraint function for the steel tower weld seam is calculated as follows: , This represents the pixel percentage characteristic of the defect area. For illumination-image fusion features, This represents the pre-processed ambient illuminance value. For global average pooling;

[0052] A42: Calculate the dynamically adjusted anchor frame size in YOLOv8 based on the illumination-image fusion features. The calculation method is as follows:

[0053]

[0054]

[0055] in, Scaling the gating weights for the anchor frame For dimensional expansion operations, The anchor frame size is dynamically adjusted. This refers to the basic anchor frame dimensions for YOLOv8. This is an element-wise addition;

[0056] A43: Based on the illumination-image fusion features and the dynamically adjusted anchor box size, calculate the dynamically adjusted confidence threshold of YOLOv8. The calculation method is as follows:

[0057]

[0058]

[0059] in, For confidence level gating weights, This is the dynamically adjusted confidence threshold. This is the baseline confidence threshold for YOLOv8. It is an exponential function.

[0060] It should be further explained that the illuminance value of the outdoor environment where the steel tower is located fluctuates drastically. After the initial illumination correction, the pixel ratio of the defect area in the final weld image will fluctuate significantly due to changes in illumination intensity. The clarity of the weld edge will also vary depending on the illumination conditions. The fixed anchor frame size and confidence threshold used in the traditional YOLOv8 model cannot adapt to the dynamic changes in defect morphology caused by illumination. If the anchor frame size does not match the actual proportion of the defect, it will cause the defect location to shift. If the confidence threshold remains unchanged, it is very easy to miss or misdetect in weak or strong light scenarios where the weld edge is blurred, which will affect the accuracy and stability of outdoor weld defect detection.

[0061] This invention first uses the final corrected weld image and preprocessed ambient illumination values ​​as input. By extracting weld edge sharpness features and defect area pixel proportion features, and combining these with a constraint function for the steel tower weld domain, effective features fitting the steel tower weld scene are selected. These are then fused to obtain illumination-image fusion features, which not only carry the structural information of the weld image but also incorporate the real-time state of ambient illumination, providing a precise scene adaptation basis for parameter adjustment. Next, the dynamically adjusted anchor frame size is based on the YOLOv8 base anchor frame size. Using the illumination-image fusion features, defect area pixel proportion features, and preprocessed ambient illumination values, the anchor frame size is adaptively scaled through dynamic adjustment of gating weights. When the defect area pixel proportion increases, the anchor frame expands synchronously; when the proportion decreases, the anchor frame shrinks accordingly. Simultaneously, the ambient illumination value is used for inverse correction. To avoid misjudging the proportion of defects due to strong or weak light, and to ensure accurate matching between the anchor frame and the actual size of the defects, the dynamically adjusted confidence threshold is based on the YOLOv8 base confidence threshold. It is then adapted using light-image fusion features, the dynamically adjusted anchor frame size, weld edge clarity features, and pre-processed ambient light values. The lower the weld edge clarity and the more extreme the light intensity, the lower the threshold tends to be, avoiding missed detections due to feature blurring. Simultaneously, the threshold is finely calibrated through gating weights to prevent false detections caused by excessively low thresholds. The dynamically adjusted anchor frame size provides a relevant reference for confidence threshold adjustment. The synergistic optimization of these two parameters solves both the problem of inaccurate defect location and the challenge of rigid defect judgment standards, achieving real-time dynamic adaptation of detection parameters to changes in outdoor lighting and defect morphology.

[0062] In existing technologies, the anchor frame size and confidence threshold of the YOLOv8 model are mostly fixed or preset offline based on a single dataset. They do not consider the impact of ambient light fluctuations on the pixel ratio of the defect area and the clarity of the weld edge in outdoor steel tower weld inspection scenarios. Even when some improved solutions adjust the anchor frame or confidence threshold, they often use a single adjustment criterion and fail to deeply integrate ambient light information with weld image features. As a result, the adjusted parameters are still difficult to adapt to dynamically changing outdoor scenes. In contrast to existing technologies, the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of this invention are both based on the light-image fusion features. They are combined with the pixel ratio features of the defect area, the clarity features of the weld edge, and the preprocessed ambient light value to achieve dynamic adjustment of the two parameters. Moreover, the anchor frame size and the confidence threshold are correlated and adapted in a coordinated manner, which solves the problem that fixed parameters cannot cope with light fluctuations and improves the adaptability of the detection model in complex outdoor scenes.

[0063] This invention deeply integrates the generation process of dynamically adjusted anchor frame size and dynamically adjusted confidence threshold with the previous final weld seam correction image processing and preprocessed environmental illumination value analysis. It does not adjust the anchor frame size or confidence threshold in isolation, but reuses previously extracted weld seam edge sharpness features, defect area pixel ratio features, and illumination-image fusion features. This makes the parameter generation process related to the previous processing steps, ensuring that parameter adjustments accurately reflect the effects of previous image processing. Simultaneously, the dynamically adjusted anchor frame size and dynamically adjusted confidence threshold are not generated independently; the dynamic adjustment of the anchor frame size provides an effective reference for the calibration of the confidence threshold, achieving coordinated optimization of the two parameters. This integrated approach solves the problem of traditional parameter adjustment being disconnected from scene features and overcomes the challenge of insufficient detection accuracy due to a lack of coordination between parameters. It enables the detection model parameters to adapt in real time to changes in outdoor illumination and differences in weld seam defect features, achieving synergy between image preprocessing, illumination correction, and detection model parameter generation. This provides crucial assurance for the accuracy and stability of subsequent weld seam defect identification.

[0064] Furthermore, step A6 also includes:

[0065] A61: Input the final weld seam correction image into the configured YOLOv8 model. The model's built-in feature extraction network performs multi-scale feature extraction on the final weld seam correction image, sequentially obtaining the shallow texture features, mid-level structural features, and deep semantic features of the weld seam image, and combining them into a multi-scale fusion feature of the weld seam.

[0066] A62: Based on the multi-scale fusion features of the weld, feature enhancement and upsampling / downsampling fusion processing are performed on the multi-scale fusion features of the weld through the feature pyramid network and path aggregation network in the configured YOLOv8 model; combined with the dynamically adjusted anchor frame size, candidate boxes for weld defects are generated.

[0067] A63: Based on the dynamically adjusted confidence threshold, the candidate boxes for weld defects are screened for confidence, and candidate boxes with confidence below the threshold are removed. Then, the remaining candidate boxes for weld defects are redundancy removed by the non-maximum suppression algorithm to obtain the weld defect identification results, including the location of the weld defect, the defect type, and the defect confidence.

[0068] Furthermore, the multilayer perceptron, residual blocks, convolutional layers, attention mechanism, and YOLOv8 model are all trained using an end-to-end neural network training method. The training data consists of preprocessed weld images, preprocessed ambient illumination values, and corresponding label data indicating the location and type of weld defects. During training, a combination of cross-entropy loss function and mean squared error loss function is used as the loss function, and the Adam optimizer is selected as the optimizer.

[0069] This invention also discloses an illumination-adaptive steel tower weld image defect recognition system, comprising:

[0070] Image acquisition module: Acquires original images of steel tower welds and ambient illuminance values, and performs preprocessing to obtain preprocessed weld images and preprocessed ambient illuminance values;

[0071] Illumination correction module: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the dynamic correction weight calculation module calculates the illumination correction weight and illumination correction coefficient; then it calculates the illumination perception attention weight and generates the illumination-corrected weld image.

[0072] Local fine correction module: For the weld image after illumination correction, the block correction weight is calculated through the weld block illumination weighting mechanism, and a locally fine-corrected weld image is generated. Then, the defect texture features are enhanced to obtain the final weld correction image.

[0073] Parameter calculation module: Based on the final weld correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features, and calculate the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of YOLOv8 in sequence.

[0074] Parameter configuration module: The dynamically adjusted anchor frame size is used as the anchor frame configuration parameter of the YOLOv8 model, and the dynamically adjusted confidence threshold is used as the detection and judgment threshold parameter of the YOLOv8 model. These parameters are integrated to form a YOLOv8 core parameter group that matches the current steel tower weld detection scenario. The YOLOv8 core parameter group is then assigned to the corresponding parameter configuration item of the YOLOv8 basic model to obtain the configured YOLOv8 model.

[0075] Weld defect identification module: Based on the configured YOLOv8 model, it performs defect identification on the final weld correction image to obtain the weld defect identification result.

[0076] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0077] (1) This invention effectively solves the problems of insufficient accuracy and poor stability of traditional steel tower weld defect identification methods in complex outdoor lighting environments: First, the collected original image and ambient illuminance value are preprocessed, and then the ambient illuminance value is combined with the dynamic correction and block weighting mechanism to complete the illumination correction and defect texture enhancement, generating the final weld correction image. At the same time, based on the features of the correction image and the real-time illuminance value, the anchor frame size and confidence threshold of the YOLOv8 model are dynamically adjusted to form a detection model adapted to the current scene, breaking through the limitations of traditional algorithms and existing deep learning models that are difficult to adapt to outdoor lighting fluctuations. Through the deep integration of the illumination correction module and the detection model, the adaptation of detection parameters and scene features is realized, improving the accuracy and stability of weld defect identification.

[0078] (2) To address the problem of local overexposure and shadows in outdoor steel tower weld images due to light fluctuations, the dynamic correction weight calculation module takes the pre-processed weld image and the ambient illuminance value as input, and calculates the light correction weight and coefficient by integrating the features of both. This effectively offsets the image interference caused by light fluctuations, avoids the loss of details caused by local overexposure and the decrease in contrast caused by shadows, and can completely preserve the core structure and defect information of the weld, preventing feature distortion or loss during the correction process. At the same time, it restores the integrity and clarity of image details, solves the pain points of traditional correction methods being difficult to adapt to dynamic lighting environments and having unstable correction effects, and provides a high-quality image foundation with uniform lighting and clear features for subsequent weld defect identification.

[0079] (3) To address the problem that uneven local illumination and subtle defect textures are easily obscured in weld images after illumination correction, this invention innovatively constructs a weld block illumination weighting mechanism. By combining block operations with illumination correction coefficients, block correction weights are calculated. Residual blocks and skip connections are used to achieve targeted local correction and preservation of original features. Then, image gradients are fused through depthwise separable convolution and features are extracted using the Laplacian operator. Attention mechanisms are used to focus on defects and suppress background noise. Feature fusion and resolution restoration are completed through pixel rearrangement convolution and residual dense blocks. This solves the problems of local subtle overexposure and weak light shadows, avoids the inadequacy of overall correction, and maximizes the highlighting of subtle defect textures such as cracks and pores. It prevents feature distortion or loss and provides a high-quality image foundation with uniform illumination and clear textures for subsequent defect identification, improving the sufficiency and reliability of defect feature extraction under complex illumination.

[0080] (4) In view of the poor adaptability of the fixed anchor frame size and confidence threshold of traditional YOLOv8 to outdoor light fluctuations, which easily leads to positioning offset and false detection, this invention extracts the features of weld edge clarity and defect area pixel ratio of the final weld correction image. Combined with the preprocessed ambient illuminance value and steel tower weld domain constraint function, a light-image fusion feature of fusion scene and light information is generated. Based on the YOLOv8 basic parameters, the anchor frame size is dynamically scaled with the defect ratio through gating weight adjustment and illuminance inverse correction. Relying on the fusion feature, dynamic anchor frame and scene features, the confidence threshold is adapted to the edge clarity and light extreme degree. The two parameters are optimized in synergy, realizing the dynamic adaptation of detection parameters with outdoor light and defect morphology. This not only solves the problem of inaccurate positioning of fixed anchor frames, but also overcomes the problem of false detection caused by threshold rigidity, and improves the accuracy and stability of weld defect detection under complex outdoor lighting. Attached Figure Description

[0081] Figure 1 A schematic flowchart of an illumination-adaptive steel tower weld image defect recognition method provided by the present invention;

[0082] Figure 2 The final weld correction image and defect detection results provided by this invention. Detailed Implementation

[0083] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.

[0084] Example 1: A method for identifying defects in steel tower weld images based on illumination adaptation, such as... Figure 1 As shown, it includes the following steps:

[0085] A1: Acquire the original image of the steel tower weld and the ambient illuminance value, and perform preprocessing to obtain the preprocessed weld image and the preprocessed ambient illuminance value, including:

[0086] A11: Acquires original images of the steel tower weld seams of the wind turbine generator set using an industrial-grade camera; the data type is two-dimensional RGB image data. Simultaneously, acquires ambient illuminance values ​​synchronized with the original images of the steel tower weld seams using a light sensor; the data type is numerical data.

[0087] A12: Gaussian filtering is used to denoise the original image of the steel tower weld to obtain a denoised weld image. Then, linear interpolation is used to unify the resolution of the denoised weld image to obtain a cleaned weld image.

[0088] A13: Linear normalization is applied to the cleaned weld image to map the pixel values ​​of the RGB channels of the image from the original 0-255 range to the 0-1 range, thus obtaining the preprocessed weld image.

[0089] A14: Normalize the ambient illuminance values ​​to obtain the preprocessed ambient illuminance values.

[0090] A2: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the illumination correction weight and illumination correction coefficient are calculated through the dynamic correction weight calculation module; then, the illumination perception attention weight is calculated, and an illumination-corrected weld image is generated; specifically, the illumination-corrected weld image is generated by extracting intermediate illumination features and illumination perception attention weights, then extracting the illumination component and reflection component of the weld image, and then processing it through skip connections and deconvolution layers, including:

[0091] A21: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the illumination correction weight and illumination correction coefficient are calculated using the dynamic correction weight calculation module. The calculation method is as follows:

[0092]

[0093]

[0094] in, For illumination correction weights, For the Sigmoid function, It is a multilayer perceptron. For splicing operations, Calculated for the mean. This is a pre-processed image of the weld. This represents the pre-processed ambient illuminance value. This is the illumination correction factor. For Hadama accumulation, Calculate operators for image gradients;

[0095] A22: Based on the illumination correction coefficient and the preprocessed weld image, calculate the illumination perception attention weights and generate an illumination-corrected weld image. The calculation method is as follows:

[0096]

[0097]

[0098]

[0099]

[0100]

[0101] in, As a feature of the illumination, For residual blocks, It is a convolutional layer. For light perception attention weights, For the Softmax function, For the illumination component of the weld image, It is an exponential function. For the reflection component of the weld image, To avoid the minimum value where the denominator is 0, For skip connections, This is an image of the weld after illumination correction. It is a deconvolutional layer.

[0102] Specifically, for nighttime weld inspection scenarios with low light and low contrast, this invention also provides a method for calculating enhanced gradient features to replace step A21. The calculation method is as follows:

[0103]

[0104]

[0105] A3: For the illuminated weld image, the block correction weight is calculated using a block illumination weighting mechanism, and a locally refined corrected weld image is generated. Then, the defect texture features are enhanced to obtain the final corrected weld image, including:

[0106] A31: For the weld image after illumination correction, the block correction weight is calculated through a weld block illumination weighting mechanism, and a locally refined corrected weld image is generated. The calculation method of the weld block illumination weighting mechanism is as follows:

[0107]

[0108]

[0109] in, To correct the weights in blocks, For the Softmax function, It is a multilayer perceptron. For splicing operations, Calculated for the mean. To divide the image into segments of size 1 Non-overlapping block operations, It is a convolutional layer. The product is the Hadamard product, and k is the block index. This is an image of the weld after illumination correction. This is the illumination correction factor. To refine the local weld seam image, For residual blocks, For jump connections;

[0110] A32: Based on the locally refined weld image, the defect texture features are enhanced to obtain the final weld correction image. The calculation method is as follows:

[0111]

[0112]

[0113] in, For defect texture features, For attention mechanisms, For depthwise separable convolution, Calculate the operator for image gradient. For the Laplace operator, For Hadama accumulation, For the final weld correction image, Pixel rearrangement convolution, It is a residual dense block.

[0114] A4: Based on the final weld seam correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features, and sequentially calculate the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of YOLOv8, including:

[0115] A41: Based on the final weld seam correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features. The calculation method is as follows:

[0116]

[0117]

[0118]

[0119] in, For the weld area mask, For the Canny edge detection operator, This is a pre-processed image of the weld. For threshold filtering operation, For the clarity characteristics of weld edges, The constraint function for the steel tower weld seam is calculated as follows: , This represents the pixel percentage characteristic of the defect area. For illumination-image fusion features, This represents the pre-processed ambient illuminance value. For global average pooling;

[0120] A42: Calculate the dynamically adjusted anchor frame size in YOLOv8 based on the illumination-image fusion features. The calculation method is as follows:

[0121]

[0122]

[0123] in, Scaling the gating weights for the anchor frame For dimensional expansion operations, The anchor frame size is dynamically adjusted. This refers to the basic anchor frame dimensions for YOLOv8. This is an element-wise addition;

[0124] A43: Based on the illumination-image fusion features and the dynamically adjusted anchor box size, calculate the dynamically adjusted confidence threshold of YOLOv8. The calculation method is as follows:

[0125]

[0126]

[0127] in, For confidence level gating weights, This is the dynamically adjusted confidence threshold. This is the baseline confidence threshold for YOLOv8. It is an exponential function.

[0128] A5: Use the dynamically adjusted anchor frame size as the anchor frame configuration parameter of the YOLOv8 model, and the dynamically adjusted confidence threshold as the detection and judgment threshold parameter of the YOLOv8 model. Integrate them to form a YOLOv8 core parameter group that matches the current steel tower weld detection scenario. Then assign the YOLOv8 core parameter group to the corresponding parameter configuration item of the YOLOv8 basic model to obtain the configured YOLOv8 model.

[0129] A6: Based on the configured YOLOv8 model, perform defect identification on the final weld correction image to obtain weld defect identification results, including:

[0130] A61: Input the final weld seam correction image into the configured YOLOv8 model. The model's built-in feature extraction network performs multi-scale feature extraction on the final weld seam correction image, sequentially obtaining the shallow texture features, mid-level structural features, and deep semantic features of the weld seam image, and combining them into a multi-scale fusion feature of the weld seam.

[0131] A62: Based on the multi-scale fusion features of the weld, feature enhancement and upsampling / downsampling fusion processing are performed on the multi-scale fusion features of the weld through the feature pyramid network and path aggregation network in the configured YOLOv8 model; combined with the dynamically adjusted anchor frame size, candidate boxes for weld defects are generated.

[0132] A63: Based on the dynamically adjusted confidence threshold, the candidate boxes for weld defects are screened for confidence, and candidate boxes with confidence below the threshold are removed. Then, the remaining candidate boxes for weld defects are redundancy removed by the non-maximum suppression algorithm to obtain the weld defect identification results, including the location of the weld defect, the defect type, and the defect confidence.

[0133] For example, in the scenario of inspecting the weld seam in the middle of an outdoor wind turbine steel tower, the final weld seam correction image contains the hole defect shown in the picture. Figure 2 As shown; the traditional method uses the YOLOv8 basic detection box (the small-scale anchor box size is too small), which has a low matching degree with the actual size of the hole and a large positioning deviation. In addition, the original confidence threshold is 0.5, while the feature response value of the hole in the original image is only 0.45 due to local shadows, which is lower than the threshold and thus missed.

[0134] The detection frame dynamically adjusted by this invention fits the hole size better, the dynamic confidence threshold is adaptively lowered, the defect response value meets the threshold requirements, the hole is successfully identified and the corresponding information is output, thus avoiding the risk of missed detection.

[0135] The multilayer perceptron, residual blocks, convolutional layers, attention mechanism, and YOLOv8 model were all trained using an end-to-end neural network training method. The training data consisted of preprocessed weld images, preprocessed ambient illumination values, and corresponding label data indicating the location and type of weld defects. During training, a combination of cross-entropy loss function and mean squared error loss function was used as the loss function, and the Adam optimizer was selected as the optimizer.

[0136] Example 2: This invention also discloses an illumination-adaptive steel tower weld image defect recognition system, comprising:

[0137] Image acquisition module: Acquires original images of steel tower welds and ambient illuminance values, and performs preprocessing to obtain preprocessed weld images and preprocessed ambient illuminance values;

[0138] Illumination correction module: Based on the preprocessed weld image and the preprocessed ambient illuminance value, the dynamic correction weight calculation module calculates the illumination correction weight and illumination correction coefficient; then it calculates the illumination perception attention weight and generates the illumination-corrected weld image.

[0139] Local fine correction module: For the weld image after illumination correction, the block correction weight is calculated through the weld block illumination weighting mechanism, and a locally fine-corrected weld image is generated. Then, the defect texture features are enhanced to obtain the final weld correction image.

[0140] Parameter calculation module: Based on the final weld correction image and the preprocessed ambient illuminance value, extract the illumination-image fusion features, and calculate the dynamically adjusted anchor frame size and the dynamically adjusted confidence threshold of YOLOv8 in sequence.

[0141] Parameter configuration module: The dynamically adjusted anchor frame size is used as the anchor frame configuration parameter of the YOLOv8 model, and the dynamically adjusted confidence threshold is used as the detection and judgment threshold parameter of the YOLOv8 model. These parameters are integrated to form a YOLOv8 core parameter group that matches the current steel tower weld detection scenario. The YOLOv8 core parameter group is then assigned to the corresponding parameter configuration item of the YOLOv8 basic model to obtain the configured YOLOv8 model.

[0142] Weld defect identification module: Based on the configured YOLOv8 model, it performs defect identification on the final weld correction image to obtain the weld defect identification result.

[0143] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0145] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for illumination adaptive steel tower weld seam image defect recognition, characterized in that, The method comprises the following steps: A1: Collecting the original image of the steel tower weld, the ambient illumination value and performing preprocessing to obtain the preprocessed weld image and the preprocessed ambient illumination value; A2: According to the preprocessed weld image and the preprocessed ambient illumination value, calculating the illumination correction weight and the illumination correction coefficient through a dynamic correction weight calculation module; then calculating the illumination perception attention weight and generating the illumination corrected weld image. A3: For the illumination corrected weld image, calculating the block correction weight through a weld block illumination weighting mechanism and generating a local fine correction weld image, and then strengthening the defect texture features to obtain a final weld correction image; A4: According to the final weld correction image and the preprocessed ambient illumination value, extracting the illumination-image fusion features, and sequentially calculating the dynamically adjusted anchor box size and the dynamically adjusted confidence threshold value of YOLOv8; A5: Taking the dynamically adjusted anchor box size as the anchor box configuration parameter of the YOLOv8 model, taking the dynamically adjusted confidence threshold value as the detection judgment threshold parameter of the YOLOv8 model, integrating to form a YOLOv8 core parameter group matched with the current steel tower weld detection scene, and then assigning the YOLOv8 core parameter group to the corresponding parameter configuration item of the YOLOv8 basic model to obtain a configured YOLOv8 model; A6: According to the configured YOLOv8 model, performing defect recognition on the final weld correction image to obtain a weld defect recognition result.

2. The method of claim 1, wherein, The A1 step comprises: A11: Collecting the original image of the steel tower weld of the wind turbine generator through an industrial-grade camera, and the data type is two-dimensional RGB image data; simultaneously collecting the ambient illumination value synchronized with the original image of the steel tower weld through an illumination sensor, and the data type is numerical data; A12: Denoising the original image of the steel tower weld by using a Gaussian filter to obtain a denoised weld image, and then uniformly resolving the resolution of the denoised weld image by using a linear interpolation method to obtain a cleaned weld image; A13: Linearly normalizing the cleaned weld image to map the pixel value of the image RGB channel from the original 0-255 interval to the 0-1 interval to obtain a preprocessed weld image; A14: Performing maximum and minimum value normalization on the ambient illumination value to obtain a preprocessed ambient illumination value.

3. The method of claim 1, wherein the method further comprises: The A2 step comprises: A21: According to the preprocessed weld image and the preprocessed ambient illumination value, calculating the illumination correction weight and the illumination correction coefficient through a dynamic correction weight calculation module, and the calculation method is: wherein, is an illumination correction weight, is a Sigmoid function, is a multi-layer perceptron, is a concatenation operation, is a mean calculation, is a pre-processed weld image, is a pre-processed ambient illumination value, is an illumination correction coefficient, is a Hadamard product, is an image gradient calculation operator; A22: According to the illumination correction coefficient and the preprocessed weld image, calculating the illumination perception attention weight and generating the illumination corrected weld image, and the calculation method is: wherein, is an illumination intermediate feature, is a residual block, is a convolution layer, is an illumination-aware attention weight, is a Softmax function, is a weld image illumination component, is an exponential function, is a weld image reflectance component, is a minimum value to avoid a denominator of 0, is a skip connection, is an illumination-corrected weld image, is a deconvolution layer.

4. The method of claim 1, wherein the method further comprises: The A3 step comprises: A31: For the illumination corrected weld image, calculating the block correction weight through a weld block illumination weighting mechanism and generating a local fine correction weld image, and the calculation method of the weld block illumination weighting mechanism is: wherein, is a patch correction weight, is a Softmax function, is a multi-layer perceptron, is a concatenation operation, is a mean calculation, is an operation of dividing an image into non-overlapping patches of size is a Hadamard product, k is a patch index, is a convolution layer, is a Hadamard product, k is a patch index, is an illumination corrected weld image, is an illumination correction coefficient, is a local fine-tuned corrected weld image, is a residual block, is a skip connection; A32: According to the local fine correction weld image, strengthening the defect texture features to obtain a final weld correction image, and the calculation method is: wherein, is a defect texture feature, is an attention mechanism, is a depth separable convolution, is an image gradient computation operator, is a Laplacian operator, is a Hadamard product, is a final weld correction image, is a pixel rearrangement convolution, is a residual dense block.

5. The method of claim 4, wherein the method further comprises: The A4 step comprises: The dynamically adjusted anchor box size is based on the basic anchor box size of YOLOv8, and is adaptively adjusted in combination with the light-image fusion feature, the defect area pixel proportion feature and the preprocessed ambient illuminance value; The dynamically adjusted confidence threshold is based on the basic confidence threshold of YOLOv8, and is adaptively adjusted in combination with the light-image fusion feature, the dynamically adjusted anchor box size and the weld edge sharpness feature, and the preprocessed ambient illuminance value.

6. The method of claim 5, wherein the method further comprises: The A4 step comprises: A41: According to the final weld correction image and the preprocessed ambient illuminance value, the light-image fusion feature is extracted, and the calculation method is: wherein, is a weld region mask, is a Canny edge detection operator, is a pre-processed weld image, is a threshold filtering operation, is a weld edge sharpness feature, is a steel tower weld region constraint function, calculated as , is a defect region pixel ratio feature, is a light-image fusion feature, is a pre-processed ambient illumination value, is a global average pooling; A42: According to the light-image fusion feature, the dynamically adjusted anchor box size of YOLOv8 is calculated, and the calculation method is: wherein, is an anchor box scaling gating weight, is a dimension expansion operation, is a dynamically adjusted anchor box size, is a base anchor box size for YOLOv8, is an element-wise addition; A43: According to the light-image fusion feature and the dynamically adjusted anchor box size, the dynamically adjusted confidence threshold of YOLOv8 is calculated, and the calculation method is: wherein, is a confidence gating weight, is a dynamically adjusted confidence threshold, is a base confidence threshold for YOLOv8, is an exponential function.

7. The method of claim 6, wherein the method further comprises: The A6 step comprises: A61: The final weld correction image is input into the configured YOLOv8 model, the multi-scale feature extraction of the final weld correction image is carried out through the feature extraction network built in the model, the shallow texture feature, the middle structure feature and the deep semantic feature of the weld image are sequentially obtained, and they are combined into the weld multi-scale fusion feature; A62: According to the weld multi-scale fusion feature, the feature pyramid network and the path aggregation network in the configured YOLOv8 model are used to carry out feature enhancement and up-sampling and down-sampling fusion processing on the weld multi-scale fusion feature; in combination with the dynamically adjusted anchor box size, the weld defect candidate box is generated; A63: Based on the dynamically adjusted confidence threshold, the weld defect candidate box is subjected to confidence screening, and the candidate box with a confidence lower than the threshold is removed, and then the remaining weld defect candidate box is subjected to redundancy removal processing through a non-maximum suppression algorithm, to obtain a weld defect recognition result, including the weld defect position, the defect type and the defect confidence.

8. The method of claim 1-7, wherein, The multi-layer perception, the residual block, the convolution layer, the attention mechanism and the YOLOv8 model are all trained by using an end-to-end neural network training method, the training data uses the preprocessed weld image, the preprocessed ambient illuminance value and the label data with the weld defect position and the defect type; in the training process, the cross entropy loss function and the mean square error loss function are combined as the loss function, and the Adam optimizer is selected as the optimizer.

9. A lightning adaptive steel tower weld seam image defect recognition system, characterized in that, It comprises: An image acquisition module: acquiring the original image of the steel tower weld and the ambient illuminance value, and preprocessing to obtain the preprocessed weld image and the preprocessed ambient illuminance value; A light correction module: according to the preprocessed weld image and the preprocessed ambient illuminance value, the light correction weight and the light correction coefficient are calculated through the dynamic correction weight calculation module; then the light perception attention weight is calculated, and the light corrected weld image is generated; The local fine correction module: for the weld image after illumination correction, the block correction weight is calculated through the weld block illumination weighting mechanism, and the local fine correction weld image is generated, the defect texture feature is further enhanced, and the final weld correction image is obtained; The parameter calculation module: according to the final weld correction image and the preprocessed ambient illumination value, the illumination-image fusion feature is extracted, and the dynamically adjusted anchor box size and the dynamically adjusted confidence threshold of YOLOv8 are calculated in turn; The parameter configuration module: the dynamically adjusted anchor box size is taken as the anchor box configuration parameter of YOLOv8 model, the dynamically adjusted confidence threshold is taken as the detection judgment threshold parameter of YOLOv8 model, the YOLOv8 core parameter group matched with the current steel tower weld detection scene is integrated, and the YOLOv8 core parameter group is assigned to the corresponding parameter configuration item of YOLOv8 basic model, so that the YOLOv8 model with completed configuration is obtained; The weld defect recognition module: according to the YOLOv8 model with completed configuration, the defect recognition of the final weld correction image is carried out, and the weld defect recognition result is obtained; to realize the illumination adaptive steel tower weld image defect recognition method as claimed in any one of claims 1-8.