A method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip
By introducing a structural guide mask and region weighting mechanism, combined with adaptive threshold local binary encoding and directional feature fusion strategy, the problem of low contrast and blurred edges of the surface of galvanized aluminum-magnesium steel strip is solved, efficient image enhancement is achieved, and the accuracy of defect detection is improved.
Patent Information
- Application Number
- CN202510405127.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-04-02
AI Technical Summary
In industrial inspection, the surface images of galvanized aluminum-magnesium steel strips are often affected by the acquisition environment, reflection interference and surface texture complexity, resulting in low image contrast, blurred edges, insufficient detail expression, affecting the accuracy of subsequent defect detection, segmentation and recognition algorithms.
The structural guidance mask and region weighting mechanism are used to improve structural edge response, and combined with the adaptive threshold local binary encoding and directional feature fusion strategy, it realizes accurate extraction of textures and details at different scales. Furthermore, through a structural response guidance method based on local contrast variance, the weight fusion of multi-scale features is realized to generate enhanced images with clear boundaries, rich levels and high contrast.
It effectively improves the contrast and edge clarity of the surface coating image of galvanized aluminum-magnesium steel strip, enhances the image's detailed expression ability, improves the accuracy of defect detection, segmentation and recognition algorithms, and is suitable for the rapid detection needs in industrial environments.
Smart Images

Figure CN119904400B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image enhancement, and in particular relates to a method for enhancing the image of a surface coating of a galvanized aluminum-magnesium steel strip. Background Art
[0002] Galvanized aluminum-magnesium steel strip is a new type of high-performance anti-corrosion material, which is widely used in automobiles, construction, home appliances and other fields. The structural uniformity, edge integrity and micro-defect state of its surface coating directly affect the functional performance and service life of the product. In order to achieve high-quality surface quality control, it is necessary to rely on the image processing system to analyze and identify the surface image of the steel strip; however, in actual industrial inspection, the surface image of galvanized aluminum-magnesium steel strip is often affected by the acquisition environment, reflection interference and surface texture complexity, resulting in low image contrast, blurred edges and insufficient detail expression, which affects the accuracy of subsequent defect detection, segmentation and recognition algorithms.
[0003] Most existing image enhancement methods are based on traditional histogram equalization, edge enhancement filtering or multi-scale decomposition strategies. Although they can improve image brightness or enhance edges in some scenarios, they generally have problems such as structural loss, excessive detail enhancement or introduction of artifacts. They are difficult to adapt to the image characteristics of galvanized aluminum-magnesium steel strips with complex surface textures and frequent subtle structural changes. In addition, some deep learning-based image enhancement models rely on large-scale annotated data training, have poor generalization and high deployment costs, and are not suitable for rapid detection needs in industrial environments.
[0004] To address the above problems, the structure-guided mask and regional weighting mechanism are introduced to enhance the structural edge response, and the adaptive threshold local binary coding and directional feature fusion strategy are combined to achieve accurate extraction of textures and details of different scales. The structure response guidance method based on local contrast variance is further adopted to realize the weighted fusion of multi-scale features, and finally the enhanced surface coating image of galvanized aluminum-magnesium steel strip with clear boundaries, rich layers and high contrast is output. Summary of the invention
[0005] The present invention provides a method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip, aiming to propose a coating image enhancement model, wherein a multi-scale feature extraction module adopts a method combining an improved adaptive threshold local binary pattern with a directional gradient feature to extract edge textures and structural features at different scales; wherein a feature selective enhancement module adopts an improved multi-scale directional response suppression and sparse activation enhancement method to perform directional saliency selection and detail area response enhancement on a multi-scale feature map; wherein a cross-scale feature fusion module constructs a structural response map based on local contrast variance to achieve pixel-level weighted fusion of multi-scale feature maps, and finally outputs an enhanced surface coating image of the galvanized aluminum-magnesium steel strip.
[0006] The present invention aims to propose a coating image enhancement model and provide a method for enhancing the coating image on the surface of a galvanized aluminum-magnesium steel strip, which comprises the following steps.
[0007] S1. Collect images of the surface coating of galvanized aluminum-magnesium steel strips, use industrial cameras to shoot the surface coating of galvanized aluminum-magnesium steel strips, and construct a dataset of images of the surface coating of galvanized aluminum-magnesium steel strips.
[0008] S2. The structure perception mechanism and region guided filtering strategy are introduced, and the surface coating image of galvanized aluminum-magnesium steel strip is preprocessed using the improved edge preserving filtering method.
[0009] S3. Construct a multi-scale feature extraction module and use a method combining an improved adaptive threshold local binary pattern and simplified directional gradient features to extract multi-scale features of the surface coating image of the galvanized aluminum-magnesium steel strip.
[0010] S4. Construct a feature selective enhancement module, adopt an improved multi-scale directional response suppression and sparse activation enhancement method to enhance the response of salient areas in the multi-scale feature map and activate the local expression ability of edge detail features.
[0011] S5. Construct a cross-scale feature fusion module, adopt a weighted fusion method based on local contrast variance guidance, uniformly align and structure-sensitively fuse enhanced feature maps of different scales, and generate an enhanced surface coating image of galvanized aluminum-magnesium steel strip.
[0012] S6. Construct a coating image enhancement model, which includes input, multi-scale feature extraction module, feature selective enhancement module, cross-scale feature fusion module and output.
[0013] Preferably, in S1, a high-resolution grayscale industrial camera is selected, combined with an industrial lens, a fixed light source device and an external synchronous trigger system, to capture images of the surface coating of the galvanized aluminum-magnesium steel strip. The acquisition process includes multiple batches of steel strip samples with different processing technologies and different surface conditions. The acquired images include normal coating areas, blurred boundary areas, reflection interference areas, uneven texture distribution areas and typical surface defect areas (such as black spots, shrinkage cavities, pinholes, etc.), and a galvanized aluminum-magnesium steel strip surface coating image dataset is constructed.
[0014] Preferably, in S2, the surface coating image of the galvanized aluminum-magnesium steel strip is preprocessed, and the specific process is:
[0015] S21, input the collected two-dimensional grayscale image of the surface coating of the galvanized aluminum-magnesium steel strip , use the Sobel operator to calculate the edge response intensity of a two-dimensional grayscale image , the specific calculation formula is:
[0016] ;
[0017] In the formula, and is the gradient component of the two-dimensional grayscale image in the x and y directions;
[0018] Define a local window area of size w×w with any pixel (x, y) in the two-dimensional grayscale image as the center , introduces a structure-aware mechanism and constructs a structure-aware map by weighted fusion of the edge response intensity and grayscale variance of a two-dimensional grayscale image , the mathematical formula of the structure perception graph is:
[0019] ;
[0020] In the formula, is a tuning parameter used to control the relative weight between edge response and texture intensity. is the grayscale variance in the local window area;
[0021] S22. Design of adaptive threshold , the structure perception map is divided into structurally significant areas and common areas, and the mathematical formula of the adaptive threshold is:
[0022] ;
[0023] In the formula, is the full-image mean of the structure-aware graph, is a tuning parameter used to control the structural significance, is the full-image standard deviation of the structure-aware graph;
[0024] Introducing a region-guided filtering strategy and using adaptive thresholds to construct a region-guided mask , the mathematical formula of the region-guided mask is:
[0025] ;
[0026] S23, using the structure perception map as the guide map and the regional guide mask as the auxiliary adjustment factor, edge-preserving filtering is performed on the two-dimensional grayscale image to construct a joint guidance weight function , the specific calculation formula is:
[0027] ;
[0028] In the formula, is the structural perception value of the pixel at the current position, is the structural perception value of the pixel point (i, j) in the neighborhood, is the structural similarity adjustment parameter;
[0029] Based on the weight function of joint guidance, the two-dimensional grayscale image is weighted and summed, and the pixel value after filtering and enhancement is calculated to obtain the preprocessed surface image of the galvanized aluminum-magnesium steel strip. , the specific calculation formula is:
[0030] ;
[0031] In the formula, is the filter window neighborhood.
[0032] Preferably, in S2, the surface coating image of the galvanized aluminum-magnesium steel strip is preprocessed, and a structure perception method combining edge response and grayscale variance is adopted to generate a structure perception map, and a region-guided mask is generated through an adaptive threshold to implement edge-preserving filtering; this method effectively retains the edges and details of the surface coating image of the galvanized aluminum-magnesium steel strip while removing noise, thereby improving the structural clarity of the surface coating image of the galvanized aluminum-magnesium steel strip.
[0033] Preferably, in S3, the method for constructing the multi-scale feature extraction module is:
[0034] S31, construct the pre-processed galvanized aluminum-magnesium steel strip surface coating image into a multi-scale image pyramid, obtain images of different resolutions through Gaussian downsampling, and First perform Gaussian blur processing and then downsample to obtain the next level of scale image , the specific calculation formula is:
[0035] ;
[0036] In the formula, The standard deviation is The Gaussian kernel function, is the convolution operation, It is to downsample the image after Gaussian blur by 2 times;
[0037] S32. For each scale image, define the central pixel and a The local window is used to extract all adjacent pixel values from the local window and calculate the local adaptive threshold of the central pixel. , the specific calculation formula is:
[0038] ;
[0039] In the formula, is the mean of the local window, is the grayscale standard deviation of the local window, It is an adjustment parameter to control the intensity of texture response;
[0040] Based on the local adaptive threshold, a binary encoding function is used to encode the pattern of each central pixel to obtain the local binary texture feature map corresponding to each scale image. , the specific calculation formula is:
[0041] ;
[0042] Where P is the number of neighborhood pixels, s is a sign function that outputs 1 when the neighborhood pixel value is greater than or equal to the threshold, otherwise it outputs 0;
[0043] S33, using the Sobel operator to calculate the gradient values in the horizontal and vertical directions for each scale image, and calculating the gradient direction angle of each pixel point from the gradient values , the specific calculation formula is:
[0044] ;
[0045] In the formula, and are the gradient values of each scale image in the horizontal and vertical directions respectively;
[0046] The gradient direction angle is divided into zones with equal intervals and mapped to the preset D direction zones, and the directional feature map corresponding to each scale image is obtained. , the specific calculation formula is:
[0047] ;
[0048] S34, for each layer , the local binary texture feature map is fused with the directional feature map to obtain a joint feature map , the specific calculation formula is:
[0049] ;
[0050] In the formula, is a normalization operation, is the fusion weight factor.
[0051] Preferably, in S3, for the multi-scale feature extraction module, a method combining an improved adaptive threshold local binary pattern and a simplified directional gradient feature is adopted. This method extracts the edge structure and local texture features of the preprocessed galvanized aluminum-magnesium steel strip surface coating image at different scales, has certain noise resistance and adaptability, can improve the feature expression ability of the boundary blurred area and the brightness change area, reduce the interference of invalid feature information, and is conducive to multi-scale feature extraction strong module to extract stable and discriminative galvanized aluminum-magnesium steel strip surface coating image features.
[0052] Preferably, in S4, the method for constructing the feature selective enhancement module is:
[0053] S41. Construct a directional enhancement response map of the joint feature map. For any pixel point in the joint feature map, its directional index is recorded as , , select the direction with the pixel as the center Expanded neighborhood window , calculate the pixel in the direction The response strength , the specific calculation formula is:
[0054] ;
[0055] According to the directional response strength, a sparse activation strategy is designed. The directional response strength values are normalized and calculated through the softmax function to obtain the directional activation factor. , the specific calculation formula is:
[0056] ;
[0057] Plot the direction activation factor against the response corresponding to each direction Perform weighted fusion to obtain each layer Directional enhancement response diagram , the specific calculation formula is:
[0058] ;
[0059] S42, introduce the linear fusion mechanism, and perform weighted fusion of the joint feature map and the direction enhancement response map to obtain each layer Enhanced feature map , the specific calculation formula is:
[0060] ;
[0061] In the formula, is the sparse activation enhancement weight coefficient.
[0062] Preferably, in S4, for the feature selective enhancement module, an improved multi-scale directional response suppression and sparse activation enhancement method is used to enhance the response of areas with directional significance in the multi-scale feature map, and suppress non-target areas. This method can enhance the response intensity of structural edges and texture details, suppress interference caused by background or repeated areas, and improve the local contrast and discrimination ability of the feature map.
[0063] Preferably, in S5, the construction method of the cross-scale feature fusion module is:
[0064] S51, upsampling the enhanced feature map at each scale, adjusting it to the same spatial resolution as the preprocessed galvanized aluminum-magnesium steel strip surface coating image, and obtaining the upsampled enhanced feature map at each scale , the specific calculation formula is:
[0065] ;
[0066] In the formula, is the interpolation weight, and ;
[0067] S52, for each scale upsampling enhanced feature map, pixel Construct a center of size Sliding window , calculate the mean grayscale value of pixels in the sliding window , the specific calculation formula is:
[0068] ;
[0069] Where Q is the number of pixels in the sliding window, and ;
[0070] The pixel grayscale variance in the sliding window is calculated by the mean grayscale value of the pixels in the sliding window, and the structural response map at the current scale is obtained. , the specific calculation formula is:
[0071] ;
[0072] After obtaining the structural response graphs at all scales, the fusion weights are constructed by normalization. , the specific calculation formula is:
[0073] ;
[0074] Where L is the total number of scales;
[0075] According to the structural response weights of feature maps of different scales at the same position, the sampled enhanced feature maps at each scale are weighted combined to obtain the enhanced surface coating image of the galvanized aluminum-magnesium steel strip. , the specific calculation formula is:
[0076] .
[0077] Preferably, in S5, for the cross-scale feature fusion module, by constructing a structural response map based on local contrast variance, the structural weights of each scale feature map at different positions are calculated to achieve pixel-level weighted fusion processing. This method can retain the layer information with rich texture and prominent structure during the fusion process, suppress the influence of redundant and fuzzy features, and is beneficial to improving the edge clarity and overall layering of the fused image, and generating a clear enhanced image of the surface coating of the galvanized aluminum-magnesium steel strip.
[0078] Compared with the prior art, the present invention has the following technical effects:
[0079] The technical solution provided by the present invention proposes a coating image enhancement model, wherein a multi-scale feature extraction module adopts a method combining an improved adaptive threshold local binary pattern with a directional gradient feature to extract edge textures and structural features at different scales; wherein a feature selective enhancement module adopts an improved multi-scale directional response suppression and sparse activation enhancement method to perform directional saliency selection and detail area response enhancement on a multi-scale feature map; wherein a cross-scale feature fusion module constructs a structural response map based on local contrast variance to achieve pixel-level weighted fusion of multi-scale feature maps, and finally outputs an enhanced coating image on the surface of a galvanized aluminum-magnesium steel strip. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is a flow chart of image data processing of surface coating of galvanized aluminum-magnesium steel strip provided by the present invention.
[0081] Figure 2 It is a structural diagram of the multi-scale feature extraction module provided by the present invention.
[0082] Figure 3 This is a structural diagram of the feature selective enhancement module provided by the present invention.
[0083] Figure 4 This is a rendering of the surface coating of the galvanized aluminum-magnesium steel strip provided by the present invention before image enhancement.
[0084] Figure 5 This is a diagram showing the enhanced image of the surface coating of the galvanized aluminum-magnesium steel strip provided by the present invention. DETAILED DESCRIPTION
[0085] The present invention aims to propose a method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip, and proposes a coating image enhancement model, wherein a multi-scale feature extraction module adopts a method combining an improved adaptive threshold local binary pattern with a directional gradient feature to extract edge textures and structural features at different scales; wherein a feature selective enhancement module adopts an improved multi-scale directional response suppression and sparse activation enhancement method to perform directional saliency selection and detail area response enhancement on a multi-scale feature map; wherein a cross-scale feature fusion module constructs a structural response map based on local contrast variance to achieve pixel-level weighted fusion of multi-scale feature maps, and finally outputs an enhanced surface coating image of the galvanized aluminum-magnesium steel strip.
[0086] See also Figure 1 As shown, a method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip in an embodiment of the present application.
[0087] S1. Collect images of the surface coating of galvanized aluminum-magnesium steel strips, use industrial cameras to shoot the surface coating of galvanized aluminum-magnesium steel strips, and construct a dataset of images of the surface coating of galvanized aluminum-magnesium steel strips.
[0088] Furthermore, in S1, a high-resolution grayscale industrial camera is selected, combined with an industrial lens, a fixed light source device and an external synchronous trigger system, to capture images of the surface coating of galvanized aluminum-magnesium steel strips. The acquisition process includes steel strip samples from multiple batches, different processing technologies and different surface conditions. The acquired images include normal coating areas, fuzzy boundary areas, reflection interference areas, uneven texture distribution areas and typical surface defect areas (such as black spots, shrinkage cavities, pinholes, etc.), and a galvanized aluminum-magnesium steel strip surface coating image dataset is constructed.
[0089] S2. The structure perception mechanism and region guided filtering strategy are introduced, and the surface coating image of galvanized aluminum-magnesium steel strip is preprocessed using the improved edge preserving filtering method.
[0090] Further, in S2, the surface image of the galvanized aluminum-magnesium steel strip is preprocessed, and the specific process is as follows:
[0091] S21, input the collected two-dimensional grayscale image of the surface of the galvanized aluminum-magnesium steel strip , use the Sobel operator to calculate the edge response intensity of a two-dimensional grayscale image , the specific calculation formula is:
[0092] ;
[0093] In the formula, and is the gradient component of the two-dimensional grayscale image in the x and y directions;
[0094] During the implementation process, and The calculation formula is:
[0095] ;
[0096] ;
[0097] Define a local window area of size w×w with any pixel (x, y) in the two-dimensional grayscale image as the center In the implementation process, the value of w is 5, and the average gray value in the local window area is calculated. , the specific calculation formula is:
[0098] ;
[0099] Calculate the grayscale variance in the local window area , the specific calculation formula is:
[0100] ;
[0101] The structure perception mechanism is introduced to construct a structure perception map by weighted fusion of the edge response intensity and grayscale variance of the two-dimensional grayscale image. , the mathematical formula of the structure perception graph is:
[0102] ;
[0103] In the formula, is an adjustment parameter. In the implementation process, the initial value is set to 0.5, and the value range is 0 to 1. When paying attention to the edge information of the image, Adjust to the range of 0.7 to 0.9. When focusing on weak textures or micro defects in the image, Adjust to the range of 0.3 to 0.5;
[0104] S22. Design of adaptive threshold , the structure perception map is divided into structurally significant areas and common areas, and the mathematical formula of the adaptive threshold is:
[0105] ;
[0106] In the formula, is the full-image mean of the structure-aware graph, It is a tuning parameter used to control the structural significance. In the implementation process, the initial value is set to 1 and the value range is 0.5 to 1. is the full-image standard deviation of the structure-aware graph;
[0107] During the implementation process, and The calculation formula is:
[0108] ;
[0109] ;
[0110] Where M and N are the width and height of the structure perception map;
[0111] Introducing a region-guided filtering strategy and using adaptive thresholds to construct a region-guided mask , the mathematical formula of the region-guided mask is:
[0112] ;
[0113] In the formula, the pixels with a mask value of 1 belong to the structurally significant area, and the pixels with a mask value of 0 belong to the ordinary background area;
[0114] S23, using the structure perception map as the guide map and the regional guide mask as the auxiliary adjustment factor, edge-preserving filtering is performed on the two-dimensional grayscale image to construct a joint guidance weight function , the specific calculation formula is:
[0115] ;
[0116] In the formula, is the structural perception value of the pixel at the current position, is the structural perception value of the pixel point (i, j) in the neighborhood, is the structural similarity adjustment parameter. In the implementation, the initial value is set to 0.5 and the value range is from 0.1 to 0.5;
[0117] Based on the weight function of joint guidance, the two-dimensional grayscale image is weighted and summed, and the pixel value after filtering and enhancement is calculated to obtain the preprocessed surface image of the galvanized aluminum-magnesium steel strip. , the specific calculation formula is:
[0118] ;
[0119] In the formula, is the filter window neighborhood. In the implementation, the size of the neighborhood is 7×7.
[0120] S3. Construct a multi-scale feature extraction module and use a method combining an improved adaptive threshold local binary pattern and simplified directional gradient features to extract multi-scale features of the surface coating image of the galvanized aluminum-magnesium steel strip.
[0121] Furthermore, in S3, the structure diagram of the multi-scale feature extraction module is as follows Figure 2 As shown, the construction method is:
[0122] S31, construct the pre-processed galvanized aluminum-magnesium steel strip surface image into a multi-scale image pyramid, obtain images of different resolutions through Gaussian downsampling, and First perform Gaussian blur processing and then downsample to obtain the next level of scale image , the specific calculation formula is:
[0123] ;
[0124] In the formula, The standard deviation is Gaussian kernel function, in the implementation process, The initial value of is set to 1, and the range is 0.8 to 2. is the convolution operation, It is to downsample the image after Gaussian blur by 2 times;
[0125] S32. For each scale image, define the central pixel and a The local window, during the implementation The value of is 5, all adjacent pixel values are extracted from the local window, and the local adaptive threshold of the central pixel is calculated , the specific calculation formula is:
[0126] ;
[0127] In the formula, is the mean of the local window, is the grayscale standard deviation of the local window, is a tuning parameter. During implementation, The initial value of is set to 0.5, and the value range is 0.2 to 1;
[0128] During the implementation process, and The calculation formula is:
[0129] ;
[0130] ;
[0131] Where Z is the total number of pixels in the local window, and ;
[0132] Based on the local adaptive threshold, a binary encoding function is used to encode the pattern of each central pixel to obtain the local binary texture feature map corresponding to each scale image. , the specific calculation formula is:
[0133] ;
[0134] Where P is the number of neighborhood pixels. In the implementation, P is set to 8. s is a sign function that outputs 1 when the neighborhood pixel value is greater than or equal to the threshold, otherwise it outputs 0.
[0135] S33, using the Sobel operator to calculate the gradient values in the horizontal and vertical directions for each scale image, and calculating the gradient direction angle of each pixel point from the gradient values , , the specific calculation formula is:
[0136] ;
[0137] In the formula, and are the gradient values of each scale image in the horizontal and vertical directions respectively;
[0138] The gradient direction angle is divided into zones with equal intervals and mapped to the preset D direction zones. , get the directional feature map corresponding to each scale image , the specific calculation formula is:
[0139] ;
[0140] S34, for each layer , the local binary texture feature map is fused with the directional feature map to obtain a joint feature map , the specific calculation formula is:
[0141] ;
[0142] In the formula, is a normalization operation, is the fusion weight factor. In the implementation process, The initial value of is set to 0.5 and the range is 0.3 to 0.7.
[0143] S4. Construct a feature selective enhancement module, adopt an improved multi-scale directional response suppression and sparse activation enhancement method to enhance the response of salient areas in the multi-scale feature map and activate the local expression ability of edge detail features.
[0144] Furthermore, in S4, the structure diagram of the feature selective enhancement module is as follows Figure 3 As shown, the construction method is:
[0145] S41. Construct a directional enhancement response map of the joint feature map. For any pixel point in the joint feature map, its directional index is recorded as , , select the direction with the pixel as the center Expanded neighborhood window , calculate the pixel in the direction The response strength , the specific calculation formula is:
[0146] ;
[0147] According to the directional response strength, a sparse activation strategy is designed. The directional response strength values are normalized and calculated through the softmax function to obtain the directional activation factor. , the specific calculation formula is:
[0148] ;
[0149] Plot the direction activation factor against the response corresponding to each direction Perform weighted fusion to obtain each layer Directional enhancement response diagram , the specific calculation formula is:
[0150] ;
[0151] During implementation, the response map corresponding to each direction The specific calculation formula is:
[0152] ;
[0153] In the formula, is the convolution operation, It is Directional Sobel kernel in 2 directions;
[0154] S42, introduce the linear fusion mechanism, and perform weighted fusion of the joint feature map and the direction enhancement response map to obtain each layer Enhanced feature map , the specific calculation formula is:
[0155] ;
[0156] In the formula, is the sparse activation enhancement weight coefficient. In the implementation process, the initial value is set to 0.5 and the value range is 0 to 1.
[0157] S5. Construct a cross-scale feature fusion module, adopt a weighted fusion method based on local contrast variance guidance, uniformly align and structure-sensitively fuse enhanced feature maps of different scales, and generate an enhanced surface coating image of galvanized aluminum-magnesium steel strip.
[0158] Furthermore, in S5, the construction method of the cross-scale feature fusion module is as follows:
[0159] S51, upsampling the enhanced feature map at each scale, adjusting it to the same spatial resolution as the preprocessed galvanized aluminum-magnesium steel strip surface coating image, and obtaining the upsampled enhanced feature map at each scale , the specific calculation formula is:
[0160] ;
[0161] In the formula, is the interpolation weight, and ;
[0162] S52, for each scale upsampling enhanced feature map, pixel Construct a center of size Sliding window , during the implementation Set to 5 to calculate the mean grayscale value of pixels in the sliding window , the specific calculation formula is:
[0163] ;
[0164] Where Q is the number of pixels in the sliding window, and ;
[0165] The pixel grayscale variance in the sliding window is calculated by the mean grayscale value of the pixels in the sliding window, and the structural response map at the current scale is obtained. , the specific calculation formula is:
[0166] ;
[0167] After obtaining the structural response graphs at all scales, the fusion weights are constructed by normalization. , the specific calculation formula is:
[0168] ;
[0169] Where L is the total number of scales;
[0170] According to the structural response weights of feature maps of different scales at the same position, the sampled enhanced feature maps at each scale are weighted combined to obtain the enhanced surface coating image of the galvanized aluminum-magnesium steel strip. , the specific calculation formula is:
[0171] .
[0172] S6. Construct a coating image enhancement model, which includes input, multi-scale feature extraction module, feature selective enhancement module, cross-scale feature fusion module and output.
[0173] Further, in S6, for the coating image enhancement model, a dataset of galvanized aluminum-magnesium steel strip surface coating images is constructed, and the effect diagram of the galvanized aluminum-magnesium steel strip surface coating image before enhancement is shown in FIG. Figure 4 As shown in the figure, the surface coating image of the galvanized aluminum-magnesium steel strip is preprocessed to generate a structural perception map and a regional guided mask map. The preprocessed surface coating image of the galvanized aluminum-magnesium steel strip is input into the coating image enhancement model. After the multi-scale feature extraction module, the structural texture features of the image at different scales are extracted to obtain a joint feature map; the joint feature map is input into the feature selective enhancement module, which combines the directional response map with the directional activation factor to generate a directional enhancement response map, and fuses it with the joint feature map to output an enhanced feature map; the enhanced multi-scale feature map is input into the cross-scale feature fusion module, the structural response map is calculated using the local contrast variance, the pixel-level fusion weight map is constructed, and the feature maps of each scale are weightedly fused to obtain the final enhanced image of the surface coating of the galvanized aluminum-magnesium steel strip. The effect of the enhanced surface coating image of the galvanized aluminum-magnesium steel strip is shown in the figure, Figure 5 shown.
[0174] Furthermore, in S6, for the coating image enhancement model, the loss function consists of a structural loss term and a texture contrast loss term, where the structural loss uses the mean square error to calculate the overall structural deviation of the image, and the texture contrast loss is constructed based on the contrast difference in the local area to improve the local texture clarity. The weight ratio of the structural loss to the texture loss is 1:0.2; the optimizer selects Adam, the initial learning rate is set to 0.001, the weight decay coefficient is set to 0.00001, the batch size is set to 32, and the total number of model training rounds is set to 200 rounds.
[0175] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip, characterized in that: The following steps are involved: S1. Collect images of the surface coating of galvanized aluminum-magnesium steel strips, use industrial cameras to shoot the surface coating of galvanized aluminum-magnesium steel strips, and construct a dataset of images of the surface coating of galvanized aluminum-magnesium steel strips; S2, introduce the structure perception mechanism and region guided filtering strategy, and use the improved edge preservation filtering method to preprocess the surface coating image of galvanized aluminum-magnesium steel strip; S3, construct a multi-scale feature extraction module, and use a method combining an improved adaptive threshold local binary pattern and a simplified directional gradient feature to extract multi-scale features of the surface coating image of the galvanized aluminum-magnesium steel strip; S4. Construct a feature selective enhancement module, adopt an improved multi-scale directional response suppression and sparse activation enhancement method, enhance the response of the salient areas in the multi-scale feature map, and activate the local expression ability of edge detail features; S5. Construct a cross-scale feature fusion module, adopt a weighted fusion method based on local contrast variance guidance, uniformly align and structure-sensitively fuse enhanced feature maps of different scales, and generate an enhanced surface coating image of the galvanized aluminum-magnesium steel strip; S6. Construct a coating image enhancement model, which includes input, multi-scale feature extraction module, feature selective enhancement module, cross-scale feature fusion module and output.
2. The method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip according to claim 1, characterized in that: In S2, the surface coating image of the galvanized aluminum-magnesium steel strip is preprocessed, and the specific process is as follows: S21. Input the collected two-dimensional grayscale image of the surface coating of the galvanized aluminum-magnesium steel strip , use the Sobel operator to calculate the edge response intensity of a two-dimensional grayscale image , the specific calculation formula is: ; In the formula, and is the gradient component of the two-dimensional grayscale image in the x and y directions; Define a local window area of size w×w with any pixel (x, y) in the two-dimensional grayscale image as the center , introduces a structure-aware mechanism and constructs a structure-aware map by weighted fusion of the edge response intensity and grayscale variance of a two-dimensional grayscale image , the mathematical formula of the structure perception graph is: ; In the formula, is the adjustment parameter, is the grayscale variance in the local window area; S22. Design of adaptive threshold , the structure perception map is divided into structurally significant areas and common areas, and the mathematical formula of the adaptive threshold is: ; In the formula, is the full-image mean of the structure-aware graph, is the adjustment parameter, is the full-image standard deviation of the structure-aware graph; Introducing a region-guided filtering strategy and using adaptive thresholds to construct a region-guided mask , the mathematical formula of the region-guided mask is: ; S23, using the structure perception map as the guide map and the regional guide mask as the auxiliary adjustment factor, edge-preserving filtering is performed on the two-dimensional grayscale image to construct a joint guidance weight function , the specific calculation formula is: ; In the formula, is the structural perception value of the pixel at the current position, is the structural perception value of the pixel point (i, j) in the neighborhood, is the structural similarity adjustment parameter; Based on the weight function of joint guidance, the two-dimensional grayscale image is weighted and summed, and the pixel value after filtering and enhancement is calculated to obtain the surface coating image of the preprocessed galvanized aluminum-magnesium steel strip. , the specific calculation formula is: ; In the formula, is the filter window neighborhood.
3. The method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip according to claim 2, characterized in that: In S3, the construction method of the multi-scale feature extraction module is: S31, construct the pre-processed galvanized aluminum-magnesium steel strip surface coating image into a multi-scale image pyramid, obtain images of different resolutions through Gaussian downsampling, and First perform Gaussian blur processing and then downsample to obtain the next level of scale image , the specific calculation formula is: ; In the formula, The standard deviation is The Gaussian kernel function, is the convolution operation, It is to downsample the image after Gaussian blur by 2 times; S32. For each scale image, define the central pixel and a The local window is used to extract all adjacent pixel values from the local window and calculate the local adaptive threshold of the central pixel. , the specific calculation formula is: ; In the formula, is the mean of the local window, is the grayscale standard deviation of the local window, is the adjustment parameter; Based on the local adaptive threshold, a binary encoding function is used to encode the pattern of each central pixel to obtain the local binary texture feature map corresponding to each scale image. , the specific calculation formula is: ; Where P is the number of neighborhood pixels, s is a sign function that outputs 1 when the neighborhood pixel value is greater than or equal to the threshold, otherwise it outputs 0; S33, using the Sobel operator to calculate the gradient values in the horizontal and vertical directions for each scale image, and calculating the gradient direction angle of each pixel point from the gradient values , the specific calculation formula is: ; In the formula, and are the gradient values of each scale image in the horizontal and vertical directions respectively; The gradient direction angle is divided into zones with equal intervals and mapped to the preset D direction zones, and the directional feature map corresponding to each scale image is obtained. , the specific calculation formula is: ; S34, for each layer , the local binary texture feature map is fused with the directional feature map to obtain a joint feature map , the specific calculation formula is: ; In the formula, is a normalization operation, is the fusion weight factor.
4. The method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip according to claim 3, characterized in that: In S4, the method for constructing the feature selective enhancement module is: S41. Construct a directional enhancement response map of the joint feature map. For any pixel point in the joint feature map, its directional index is recorded as , , select the direction with the pixel as the center Expanded neighborhood window , calculate the pixel in the direction The response strength , the specific calculation formula is: ; According to the directional response strength, a sparse activation strategy is designed. The directional response strength values are normalized and calculated through the softmax function to obtain the directional activation factor. , the specific calculation formula is: ; Plot the direction activation factor against the response corresponding to each direction Perform weighted fusion to obtain each layer Directional enhancement response diagram , the specific calculation formula is: ; S42, introduce the linear fusion mechanism, and perform weighted fusion of the joint feature map and the direction enhancement response map to obtain each layer Enhanced feature map , the specific calculation formula is: ; In the formula, is the sparse activation enhancement weight coefficient.
5. The method for enhancing the surface coating image of a galvanized aluminum-magnesium steel strip according to claim 4, characterized in that: In S5, the construction method of the cross-scale feature fusion module is: S51, upsampling the enhanced feature map at each scale, adjusting it to the same spatial resolution as the preprocessed galvanized aluminum-magnesium steel strip surface coating image, and obtaining the upsampled enhanced feature map at each scale , the specific calculation formula is: ; In the formula, is the interpolation weight, and ; S52, for each scale upsampling enhanced feature map, pixel Construct a center of size Sliding window , calculate the mean grayscale value of pixels in the sliding window , the specific calculation formula is: ; Where Q is the number of pixels in the sliding window, and ; The pixel grayscale variance in the sliding window is calculated by the mean grayscale value of the pixels in the sliding window, and the structural response map at the current scale is obtained. , the specific calculation formula is: ; After obtaining the structural response graphs at all scales, the fusion weights are constructed by normalization. , the specific calculation formula is: ; Where L is the total number of scales; According to the structural response weights of feature maps of different scales at the same position, the sampled enhanced feature maps at each scale are weighted combined to obtain the enhanced surface coating image of the galvanized aluminum-magnesium steel strip. , the specific calculation formula is: 。
Citation Information
Patent Citations
Dark light image enhancement method based on multi-scale feature selective fusion
CN113628152A
Ultrasonic image enhancement method based on context awareness and multi-scale diffusion network
CN118096584A