Surface defect salient target detection method based on adaptive multi-scale feature fusion

By using VGG16 network and CBAM attention mechanism to extract and weight feature maps in surface defect detection, and using adaptive multi-scale feature fusion strategy to fusion, the problems of low detection accuracy and poor robustness in the existing technology are solved, and the problem of low detection accuracy and poor robustness in the existing technology is realized. More efficient defect detection effect.

CN119478354APending Publication Date: 2025-02-18WUHAN INST OF TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411519317.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The accuracy of the surface defect significant object detection method based on adaptive multi-scale feature fusion in the prior art is not high, and its robustness and generalization ability are poor.

Method used

The VGG16 network is used to extract feature maps of multiple levels, combined with the CBAM attention mechanism for weighting, and using an adaptive multi-scale feature fusion strategy, the weighted feature maps are gradually fused in a hierarchical order from deep to shallow, including adaptive weight fusion , Global feature adaptive fusion and differential feature adaptive fusion mechanism.

Benefits of technology

It improves the accuracy, robustness and generalization ability of object surface defect detection, and can more effectively capture the differences between different features and improve the expressive ability of features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478354A_ABST
    Figure CN119478354A_ABST
Patent Text Reader

Abstract

The invention provides a surface defect salient target detection method based on adaptive multi-scale feature fusion. The method comprises the following steps: extracting feature maps of multiple levels from a surface image of an object to be detected by using a VGG16 network; weighting the feature map of each level through space and channel attention by using a CBAM attention mechanism; gradually fusing the weighted feature maps according to a hierarchical sequence from deep to shallow by using a self-adaptive multi-scale feature fusion strategy; predicting a defect area in the surface image of the to-be-detected object according to a fusion result of the feature maps; wherein the adaptive multi-scale feature fusion strategy comprises an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism. The method improves the precision of object surface defect detection, and has strong robustness and generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a surface defect salient target detection method based on adaptive multi-scale feature fusion. Background Art

[0002] As basic materials of modern industry, the quality of steel and magnets directly affects the performance and reliability of downstream products. Therefore, surface defect detection plays a vital role in the production process. Surface defects not only reduce the mechanical properties of steel, but also may cause early failure of products during use, resulting in huge economic losses and safety hazards. With the rapid development of industrial automation and intelligent manufacturing, traditional manual detection methods can no longer meet the needs of efficient and accurate quality control, and automated surface defect detection technology has emerged.

[0003] In recent years, with the rapid development of computer vision and machine learning technology, steel and tile surface defect detection methods based on image processing have received extensive attention and research. These methods can automatically identify and classify various defects such as pores, fractures, cracks and wear by analyzing and processing steel and tile surface images. Existing advanced methods mainly include traditional image processing technology and deep learning-based detection methods.

[0004] Traditional image processing techniques usually rely on edge detection, texture analysis, and morphological operations. These methods have shown certain effects in specific application scenarios, but their robustness and generalization capabilities are poor, making it difficult to cope with complex and changing actual production environments. With the rise of deep learning technology, especially the widespread application of convolutional neural networks (CNN), defect detection methods based on deep learning have gradually become a research hotspot. Deep learning methods can achieve high-precision defect detection and classification on large-scale data sets by automatically learning features in images.

[0005] For example, in recent years, some researchers have proposed defect detection models based on deep convolutional neural networks, such as FasterR-CNN (Faster Region Convolutional Neural Networks), YOLO (You Only Look Once) and SSD (Single Shot MultiBox Detector), which have achieved certain results in public data sets and actual production environments. However, Faster R-CNN may ignore some small defects when generating candidate regions, resulting in unsatisfactory detection of small defects. When dealing with multi-scale defects, YOLO may not be able to take into account the detection effects of large and small defects at the same time. SSD is prone to false detection in complex backgrounds, especially when there are interference factors such as texture and lighting changes on the steel surface, the model has poor robustness.

[0006] The U-shaped encoder-decoder framework of Resformer-Unet combines convolutional neural networks (CNNs) and Transformers to extract multi-scale features in parallel to enhance the capture of global and local information. However, this method still has certain shortcomings when dealing with defects with significant intra-class differences, especially in the accurate identification of defect locations. The surface defect detection method of steel plates based on SwinTransformer and Feature Pyramid Networks (FPN) generates the region of interest (ROI) of defects by fusing multi-scale feature maps, but its detection accuracy in complex backgrounds still needs to be improved. The Feature-Aware Network (FaNet) realizes few-sample defect classification through the Feature Attention Convolution module (FAC) and the online Feature Enhance Integration (FEI) module. Although it performs well under small sample conditions, its generalization ability to large-scale datasets remains to be verified. Summary of the invention

[0007] The present invention provides a surface defect salient target detection method based on adaptive multi-scale feature fusion, which is used to solve the defects of low accuracy, poor robustness and generalization ability of the surface defect salient target detection method based on adaptive multi-scale feature fusion in the prior art, and improve the accuracy, robustness and generalization ability of object surface defect detection.

[0008] The present invention provides a surface defect salient target detection method based on adaptive multi-scale feature fusion, comprising:

[0009] Use the VGG16 network to extract multiple levels of feature maps from the surface image of the object to be detected;

[0010] Use the CBAM attention mechanism to weight the feature maps of each level through spatial and channel attention;

[0011] Using an adaptive multi-scale feature fusion strategy, the weighted feature maps are gradually fused in a hierarchical order from deep to shallow;

[0012] Predicting defect areas in the surface image of the object to be detected according to the fusion result of the feature map;

[0013] The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism;

[0014] The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight;

[0015] The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature;

[0016] The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

[0017] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, the weighted feature maps are gradually fused in a hierarchical order from deep to shallow using an adaptive weight fusion mechanism in an adaptive multi-scale feature fusion strategy, including:

[0018] The weighted current feature map and the previous fusion result are convolved and added to generate a combined feature map.

[0019] Use the convolution layer with Sigmoid activation function to calculate the weighted convolution weights of the current feature map, the previous fusion result, and the combined feature map.

[0020] Use the spatial attention mechanism to calculate the weighted attention weights of the current feature map, the previous fusion result, and the combined feature map;

[0021] After multiplying the convolution weights of the weighted current feature map, the previous fusion result and the combined feature map with the corresponding attention weights, the weighted current feature map, the previous fusion result and the combined feature map are weighted fused.

[0022] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, the convolution weights of the weighted current feature map, the previous fusion result and the combined feature map are multiplied by the corresponding attention weights, including:

[0023] The weighted current feature map, the previous fusion result, and the convolution weight of the combined feature map are added together to obtain the total weight;

[0024] Calculate the ratio of the weighted convolution weights of the current feature map, the previous fusion result and the combined feature map to the total weight;

[0025] Multiply the weighted ratio of the current feature map, the previous fusion result, and the combined feature map by the corresponding attention weight.

[0026] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, the weighted feature maps are gradually fused in a hierarchical order from deep to shallow using a global feature adaptive fusion mechanism in an adaptive multi-scale feature fusion strategy, including:

[0027] After concatenating the weighted current feature map with the previous fusion result, the convolutional layer is used to process it to obtain a new feature map.

[0028] The new feature map is processed using global average pooling and Sigmoid function in sequence to obtain an adaptive weight of the global feature;

[0029] The weighted current feature map, the previous fusion result and the weighted fusion result output by the adaptive weight fusion mechanism are multiplied by the adaptive weight of the global feature respectively and then fused.

[0030] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, the adaptive fusion mechanism of difference features in the adaptive multi-scale feature fusion strategy is used to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, including:

[0031] The weighted current feature map and the previous fusion result are concatenated to obtain a fused feature map;

[0032] Calculating the difference feature between the fused feature map and the feature after global average pooling of the fused feature map;

[0033] Calculate the adaptive weight of the difference feature using Sigmoid function;

[0034] The fused feature map is updated according to the adaptive weights of the difference features.

[0035] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, before using the adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, the method further includes:

[0036] Multi-scale feature fusion and global autocorrelation processing are performed on the deepest feature map.

[0037] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, before extracting multiple levels of feature maps from the surface image of the object to be detected using the VGG16 network, the method further includes:

[0038] Preprocessing the data set, wherein the preprocessing includes one or more of removing negative samples, uneven samples, random rotation, and adjusting the aspect ratio;

[0039] Using the preprocessed dataset, the VGG16 network, CBAM attention mechanism and adaptive multi-scale feature fusion strategy are trained and performance evaluated as a whole.

[0040] According to a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention, the aspect ratio of the data set is adjusted by the following steps:

[0041] Calculating a scaling ratio of the sample so that the long side of the sample in the data set matches the long side in the target size, or the short side of the sample matches the short side in the target size;

[0042] Proportionally scaling the sample according to the scaling ratio;

[0043] If the size of the sample after proportional scaling is inconsistent with the target size, a blank area is filled around the sample after proportional scaling to make the size of the sample consistent with the target size.

[0044] The present invention also provides a device for detecting surface defects of an object, comprising:

[0045] An extraction module is used to extract feature maps of multiple levels from the surface image of the object to be detected using the VGG16 network;

[0046] A weighting module is used to weight the feature maps of each level through spatial and channel attention using the CBAM attention mechanism;

[0047] A fusion module, used to use an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow;

[0048] A detection module, used for predicting the defect area in the surface image of the object to be detected according to the fusion result of the feature map;

[0049] The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism;

[0050] The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight;

[0051] The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature;

[0052] The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

[0053] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for detecting significant targets of surface defects based on adaptive multi-scale feature fusion as described in any one of the above is implemented.

[0054] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for detecting significant targets of surface defects based on adaptive multi-scale feature fusion as described in any one of the above is implemented.

[0055] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned surface defect salient target detection methods based on adaptive multi-scale feature fusion.

[0056] The present invention provides a method for detecting significant targets of surface defects based on adaptive multi-scale feature fusion. A novel adaptive multi-scale feature fusion network AMSFF-Net is proposed for detecting significant targets of surface defects of objects. AMSFF-Net is divided into adaptive weight fusion, global feature adaptive fusion and differential feature adaptive fusion. The adaptive weight fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the global feature adaptive fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the differential feature adaptive fusion mechanism can effectively capture the differences between different features and enhance the expressive power of the features, thereby improving the accuracy of surface defect detection of objects, and has strong robustness and generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 It is a flow chart of a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0059] Figure 2 It is a schematic diagram of the architecture of AMSFF-Net in the surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0060] Figure 3 It is a structural schematic diagram of calculating the total weight value of the adaptive weight fusion mechanism in the surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0061] Figure 4 It is a structural schematic diagram of an adaptive weight fusion mechanism in a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0062] Figure 5 It is a structural schematic diagram of a global feature adaptive fusion mechanism in a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0063] Figure 6 It is a structural schematic diagram of a differential feature adaptive fusion mechanism in a surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention;

[0064] Figure 7It is a schematic diagram comparing the saliency maps generated by the surface defect salient target detection method based on adaptive multi-scale feature fusion provided by the present invention and three other advanced methods;

[0065] Figure 8 It is a structural schematic diagram of a surface defect salient target detection device based on adaptive multi-scale feature fusion provided by the present invention;

[0066] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] Combine the following Figure 1 The present invention describes a surface defect salient target detection method based on adaptive multi-scale feature fusion, comprising:

[0069] Step 101, using the VGG16 network to extract feature maps of multiple levels from the surface image of the object to be detected;

[0070] like Figure 2 As shown in Figure 1, in surface defect detection, the VGG16 network is selected as the backbone network to utilize its powerful feature extraction capability. The VGG16 network has been widely used in the field of image processing due to its simple structure and excellent performance. In this embodiment, the VGG16 network can be used to extract five different levels of feature maps from the input image, which are respectively denoted as Where i∈{1,2,3,4,5}. These feature maps gradually increase their semantic richness from shallow to deep layers, providing rich information for subsequent defect detection.

[0071] Step 102, using the CBAM attention mechanism to weight the feature maps of each level through spatial and channel attention;

[0072] In order to further enhance the model's ability to focus on key features, this embodiment introduces the popular CBAM (Convolutional Block Attention Module) attention mechanism in the feature extraction process. The CBAM module sequentially reweights the feature map through spatial and channel attention, effectively improving the network's sensitivity to defect areas. The introduction of this attention mechanism enables the network to focus more on the key parts of the image, thereby improving the accuracy of defect detection.

[0073] Step 103, using an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow;

[0074] In order to make full use of feature maps at different levels, this embodiment adopts an adaptive multi-scale feature fusion strategy to gradually fuse deep feature maps with shallow feature maps. This adaptive upsampling not only retains the high-level semantic information in the deep feature map, but also restores the detail information in the shallow feature map, making the final feature representation richer and more accurate. Through this hierarchical fusion strategy, the model proposed in this embodiment can effectively detect various defects on the surface of an object and significantly improve the detection performance.

[0075] Step 104, predicting the defect area in the surface image of the object to be detected according to the fusion result of the feature map;

[0076] Finally, the defect area in the surface image of the object to be detected is predicted based on the fusion result of the feature map. The defect area in the surface image of the object to be detected can be obtained using the LAM (Local Autocorrelation Module) algorithm.

[0077] The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism;

[0078] The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight;

[0079] The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature;

[0080] The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

[0081] This embodiment proposes an adaptive multi-scale feature fusion network (AMSFF-Net) to effectively fuse feature maps from different resolutions. AMSFF-Net combines adaptive weight fusion, global feature adaptive fusion, and differential feature adaptive fusion to achieve fine management and optimized fusion of features to enhance the model's characterization capabilities, and can be used for surface defects of objects such as steel and magnetic tiles.

[0082] This embodiment proposes a novel adaptive multi-scale feature fusion network AMSFF-Net for object surface defect significant object detection. AMSFF-Net is divided into adaptive weight fusion, global feature adaptive fusion and differential feature adaptive fusion. The adaptive weight fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the global feature adaptive fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the differential feature adaptive fusion mechanism can effectively capture the differences between different features and enhance the expressiveness of the features, thereby improving the accuracy of object surface defect detection, and has strong robustness and generalization ability.

[0083] On the basis of the above embodiment, the adaptive weight fusion mechanism in the adaptive multi-scale feature fusion strategy is used in this embodiment to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, including:

[0084] The weighted current feature map and the previous fusion result are convolved and added to generate a combined feature map.

[0085] Use the convolution layer with Sigmoid activation function to calculate the weighted convolution weights of the current feature map, the previous fusion result, and the combined feature map.

[0086] Use the spatial attention mechanism to calculate the weighted attention weights of the current feature map, the previous fusion result, and the combined feature map;

[0087] After multiplying the convolution weights of the weighted current feature map, the previous fusion result and the combined feature map with the corresponding attention weights, the weighted current feature map, the previous fusion result and the combined feature map are weighted fused.

[0088] The adaptive weight fusion mechanism is the core component of AMSFF-Net, which is implemented through the following steps: First, the input left and right feature maps (the weighted current feature map and the previous fusion result) are convolved to obtain the corresponding feature maps. This step extracts features at different levels through the convolution layer to provide rich feature representation for subsequent fusion. Then, the left and right feature maps are simply added to generate a combined feature map. This step helps capture the complementary information between the left and right views. The specific expressions are formula (1) and formula (2):

[0089] X feat =Conv(X) (1)

[0090] C feat =L feat +R feat (2)

[0091] For each feature map (left feature map, right feature map and combined feature map), calculate its weight separately, and then add them together to get the total weight W total ,like Figure 3 This process is implemented through a convolution layer with a Sigmoid activation function to ensure that the weight range is between 0 and 1. The Sigmoid function is used because it can smoothly limit the output weight, making the weight distribution more reasonable and avoiding interference from extreme values.

[0092] Then, the attention weight of each feature map is calculated through the spatial attention mechanism (SA). Spatial attention can effectively help the model focus on a specific spatial region of the input data, so that important information can be better extracted and integrated, while suppressing irrelevant or unimportant parts. The expressions are as follows:

[0093] W X =σ(ConvWeight(X feat )) (3)

[0094] a X =SA(X feat ) (4)

[0095] Finally, the calculated convolution weights and attention weights are combined to perform weighted fusion on each feature map.

[0096] On the basis of the above embodiment, the method described in this embodiment multiplies the weighted current feature map, the previous fusion result and the convolution weight of the combined feature map by the corresponding attention weight, including:

[0097] The weighted current feature map, the previous fusion result, and the convolution weight of the combined feature map are added together to obtain the total weight;

[0098] Calculate the ratio of the weighted convolution weights of the current feature map, the previous fusion result and the combined feature map to the total weight;

[0099] Multiply the weighted ratio of the current feature map, the previous fusion result, and the combined feature map by the corresponding attention weight.

[0100] Specifically, the weight of each feature map is first normalized to ensure that the sum of the weights of all feature maps is 1. This step ensures the stability and efficiency of the fusion process. Then, the normalized weight is multiplied with the corresponding feature map and its spatial attention weight to obtain the weighted feature map. All weighted feature maps are finally accumulated to form the final output feature map, such as Figure 4 As shown. This adaptive weight fusion strategy enables the network to automatically adjust the fusion weights according to the importance of different feature maps, thereby more accurately capturing and fusing key information. The specific expressions are formula (5) to formula (7):

[0101]

[0102] Among them, W total =W L +W R +W combined ,σ is the Sigmoid function,ω i is the calculated weight.

[0103] On the basis of the above embodiment, the global feature adaptive fusion mechanism in the adaptive multi-scale feature fusion strategy is used in this embodiment to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, including:

[0104] After concatenating the weighted current feature map with the previous fusion result, the convolutional layer is used to process it to obtain a new feature map.

[0105] The new feature map is processed using global average pooling and Sigmoid function in sequence to obtain an adaptive weight of the global feature;

[0106] The weighted current feature map, the previous fusion result and the weighted fusion result output by the adaptive weight fusion mechanism are multiplied by the adaptive weight of the global feature respectively and then fused.

[0107] In the global feature adaptive fusion stage of AMSFF-Net, the feature fusion process is further optimized to improve the model's ability to capture global context information. The main purpose of this stage is to calculate the adaptive weights of global features through global average pooling and Sigmoid function processing, such as Figure 5 As shown in Figure 3, more refined and effective feature fusion is achieved.

[0108] First, the left channel feature L and the right channel feature R are concatenated along the channel dimension to obtain Concat(L, R). Then, the concatenated result is input to the convolution layer Conv_cat for processing to generate a new feature map out1. This operation is intended to fuse the features from the left channel and the right channel so that the information can be fully utilized in the subsequent processing steps. The expression is formula (8):

[0109] out1 = Conv_cat(Concat(L,R feat )) (8)

[0110] Among them, R feat =Conv(R).

[0111] The fused feature map is subjected to global average pooling, which can help the model extract the overall feature representation, reduce the interference of local noise, and enhance the robustness of the feature. The output of global average pooling is sent to a convolutional layer with a Sigmoid activation function, which calculates the adaptive weight of each feature map, expressed as formula (9). The use of the Sigmoid function ensures that the weight value is between 0 and 1, making the weight distribution smoother and avoiding the negative impact of weight mutation on model performance.

[0112] out gX =σ(AvgPool(Conv(X input ))) (9)

[0113] Among them, X input is out1 or out, AvgPool is the global average pooling layer.

[0114] Next, the calculated adaptive weights are element-wise multiplied with the corresponding feature maps. This step is called weighted update of the feature maps, as shown in formula (10). In this way, each feature map is adjusted by its corresponding global feature weight, so that important features are emphasized and unimportant features are suppressed. This adaptive adjustment mechanism based on global feature weights helps the model capture global context information more accurately, thereby improving the effect of feature fusion and the overall performance of the model.

[0115] X updated=Conv(X)·out_gX (10)

[0116] Among them, X can be the left feature map, the R feature map or the weighted fusion result out output by the adaptive weight fusion mechanism, and out_gX is the corresponding weight coefficient.

[0117] Finally, all updated feature maps are fused again to form the final output feature map, as shown in formula (11). This fusion process is implemented through a convolution layer and a Concat operation to ensure that the information between different feature maps can be effectively integrated. Through this multi-level, multi-strategy adaptive feature fusion method, AMSFF-Net can significantly improve the model's ability to understand and represent complex scenes while maintaining efficient computing.

[0118] out = Conv_cat_2 (Concat (L updated ,R updated ,out updated )) (11)

[0119] On the basis of the above embodiment, the adaptive fusion mechanism of difference features in the adaptive multi-scale feature fusion strategy described in this embodiment gradually fuses the weighted feature maps in a hierarchical order from deep to shallow, including:

[0120] The weighted current feature map and the previous fusion result are concatenated to obtain a fused feature map;

[0121] Calculating the difference feature between the fused feature map and the feature after global average pooling of the fused feature map;

[0122] Calculate the adaptive weight of the difference feature using Sigmoid function;

[0123] The fused feature map is updated according to the adaptive weights of the difference features.

[0124] The adaptive fusion of difference features focuses on the differences between feature maps. By calculating the difference between the fused feature map and its global average pooling, and then applying the Sigmoid function, the adaptive weight of the difference feature is obtained, such as Figure 6 This method helps the model focus on the unique differences between different feature maps, further improving the effect of feature fusion. The calculation expression of the difference feature is formula (12):

[0125] out_g2=σ(Conv(out-AvgPool(out))) (12)

[0126] After obtaining the adaptive weights of the difference features, these weights are applied to the original convolutional feature map, and the feature map is weighted updated through element-by-element multiplication operations, as shown in formula (13), to enhance the model's attention to key local features.

[0127] out=Conv(out)*out_g2 (13)

[0128] Among them, σ is the Sigmoid function, AvgPool is the average pooling layer, and Conv is the convolutional layer.

[0129] Through the above three adaptive fusion mechanisms, the ASFF module can effectively integrate features from different levels and resolutions, improving the performance and robustness of the model in complex visual tasks.

[0130] On the basis of the above embodiments, before the adaptive multi-scale feature fusion strategy is used to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, the present embodiment further includes:

[0131] Multi-scale feature fusion and global autocorrelation processing are performed on the deepest feature map.

[0132] After feature extraction and attention weighting, this embodiment pays special attention to the deepest feature maps, such as Figure 2 In Because it contains the highest level of semantic information, it is particularly important for identifying complex defect patterns. This embodiment further processes the deepest feature map, including multi-scale feature fusion and global autocorrelation module (GAM) to enhance the model's ability to capture global information and context prediction capabilities. Figure 2 The CPA (Cascaded Pyramid Attention module) in is used for multi-scale feature fusion.

[0133] On the basis of the above embodiments, before extracting multiple levels of feature maps from the surface image of the object to be detected using the VGG16 network, the present embodiment also includes:

[0134] Preprocessing the data set, wherein the preprocessing includes one or more of removing negative samples, uneven samples, random rotation, and adjusting the aspect ratio;

[0135] Using the preprocessed dataset, the VGG16 network, CBAM attention mechanism and adaptive multi-scale feature fusion strategy are trained and performance evaluated as a whole.

[0136] Preprocessing plays a vital role in surface defect salient object detection. The accuracy of defect detection directly depends on the quality of the data and the validity of the features. Since the surface may have defects of various shapes and sizes, as well as other possible interference factors such as spots or lighting changes, the data must be carefully preprocessed to ensure that the model can accurately identify and locate the defective areas. Effective preprocessing can help remove noise, balance data, enhance features, and improve the robustness and generalization ability of the model.

[0137] The Magnetic-Tile-Defect dataset can be used for model training. This dataset contains image samples of various magnetic tile defects and is used to evaluate the performance of the model proposed in this embodiment in defect detection tasks and model training.

[0138] In order to ensure the effectiveness of model training and the focus of research, negative samples and uneven samples are removed from the Magnetic-Tile-Defect dataset, which contains magnetic tile defect images of pores, fractures, cracks and wear. The removal of negative samples is to solve the problem of class imbalance, which is a common problem in image processing and may cause the model to over-adapt to the majority category, thereby reducing the recognition ability of the minority category (i.e., the defect samples of this article). In addition, the research focus of this embodiment is to identify and locate specific defect types on the surface of objects, and uneven samples may not meet the defect types defined in this article. These samples may be caused by normal changes in the production process, rather than defects in the material or manufacturing process. Therefore, the inclusion of these samples may introduce irrelevant noise, affecting the model's learning and recognition of real defects. In order to improve the accuracy and generalization ability of the model, this embodiment chooses to remove these samples and renames the dataset to Focused-Defect-Detection-Tiles.

[0139] This embodiment randomly rotates the original data set and adjusts the aspect ratio. The introduction of the random rotation operation is based on the fact that surface defects may appear at any angle in an actual production environment. By randomly rotating the image within the range of [-180°, 180°], the diversity of the data can be increased, making the model better adapted to defects at different angles.

[0140] Based on the above embodiment, in this embodiment, the aspect ratio of the data set is adjusted by the following steps:

[0141] Calculating a scaling ratio of the sample so that the long side of the sample in the data set matches the long side in the target size, or the short side of the sample matches the short side in the target size;

[0142] Proportionally scaling the sample according to the scaling ratio;

[0143] If the size of the sample after proportional scaling is inconsistent with the target size, a blank area is filled around the sample after proportional scaling so that the size of the sample is consistent with the target size.

[0144] This embodiment introduces an improved joint adjustment method of image and mask to better handle defects of different shapes and sizes. Specifically, a class named JointResize is designed, which can not only adjust the image and mask to a specified size at the same time, but also choose whether to keep the aspect ratio of the original image. In this way, the image can be scaled without distortion, thereby more accurately retaining the geometric features of the defect.

[0145] While maintaining the aspect ratio, the scaling ratio is first calculated so that the long or short side of the image matches the target size, and then the image is scaled proportionally. After scaling, if the size of the image is inconsistent with the target size, blank areas are filled around the image to ensure that the final image size meets the expected size. This method not only increases the diversity of the dataset, but also effectively prevents the overfitting of the model, allowing the model to be exposed to more deformed and rotated defect samples during training, thereby improving its robustness and generalization ability in practical applications. Through this improved preprocessing step, the model's detection performance of surface defects of objects is significantly improved, laying a solid foundation for subsequent experiments and model evaluation.

[0146] In order to verify the effectiveness and practicality of the surface defect detection method proposed in this paper, a series of experiments and evaluations are carried out using the Focused-Defect-Detection-Tiles dataset. This dataset is specifically designed for surface defect detection of objects and contains many types of common defects, such as pores, fractures, cracks, and wear, which are very common in actual industrial production.

[0147] This experiment was implemented on the PyTorch framework, using an 8GB memory. During the network training phase, in order to adapt to the input requirements of the model, each image was first resized to a resolution of 256×256×3. In order to enhance the generalization ability of the model and prevent overfitting, a variety of data augmentation techniques were implemented, including random horizontal flipping, random rotation, and random color jittering. These operations can effectively expand the training data set and provide more diverse samples, thereby helping the model learn more robust features. In terms of the choice of optimizer, momentum SGD (Stochastic Gradient Descent) was used as the training algorithm, and the weight decay coefficient was set to 5e -4, to promote the stability and convergence of the model during training. The initial learning rate is set to 0.0015, combined with a polynomial decay strategy, where the decay factor is set to 0.9, which helps to gradually reduce the learning rate during training and optimize the training effect. The entire training process includes 150 epochs to ensure sufficient learning and optimization of model parameters. This paper sets the batch size to 8, which is based on experimental and hardware resource considerations to achieve a balance between training efficiency and model performance. With this setting, the network model in this paper can achieve good training results while ensuring efficiency.

[0148] In order to comprehensively evaluate the performance of the surface defect detection model proposed in this embodiment and compare it with other salient object detection (SOD) methods, six different evaluation indicators are used. These indicators include S-measure, mean absolute error (MAE), E-measure, F-measure and weighted F-measur, covering multiple aspects from structural similarity to error rate. The detailed explanation is as follows:

[0149] S-measure(S α , α=0.5): This indicator is used to evaluate the structural similarity of the model output. It is closer to the human visual perception system and can effectively reflect the model's ability to maintain the image structure.

[0150] Mean Absolute Error (MAE): This metric measures the average absolute difference between the saliency map S generated by the model and the true annotation G, and is used to evaluate the prediction accuracy of the model at the pixel level.

[0151] E-measure(E ξ ): This indicator combines global statistics and local pixel information to comprehensively evaluate the overall and local performance of the model. This example uses the mean E-measure (mean E ξ ), adaptive E-measure (adp E ξ ) and the maximum E-measure (max E ξ ) for evaluation.

[0152] F-measure(F β ): defined as the weighted harmonic mean of precision and recall, this indicator comprehensively evaluates the overall quality of the saliency map. This embodiment also uses the mean F-measure (mean F β ), adaptive F-measure (adp F β ) and the maximum F-measure (max F β ) as the evaluation criteria.

[0153] Weighted F-measure As an improved version of the traditional F-measure, the weighted F-measure corrects some defects of MAE and F-measure and provides more accurate evaluation results. 2 is 1.0.

[0154] Through these diverse evaluation indicators, we can comprehensively evaluate and compare the performance of AMSFF-Net in surface defect detection tasks to ensure its effectiveness and practicality.

[0155] In this study, several leading single image saliency detection (SDI-SOD) methods are analyzed and compared in detail, including EDRNet, DACNe, EMFINet, CSEPNet, and A3Net based on different architectures, including A3Net_VGG16 and A3Net_Res2Net50. To ensure the fairness of the comparison, all saliency images are provided by the original authors or generated under standard parameter configurations using open source code, and all resulting images are consistent in size with the original input images. This rigorous comparison process is designed to ensure the reliability and validity of the evaluation results. Figure 7 As shown in FIG. 1 , the saliency map generated by the method proposed in the present invention is compared with the saliency maps generated by several other advanced methods.

[0156] Table 1 lists the quantitative comparison results of AMSFF-Net in this study and all the comparison methods on the Focused-Defect-Detection-Tiles dataset. This paper uses nine indicators, which are marked as S α ,M, and Compared with the other 9 representative methods on the ESDIs-SOD dataset, the proposed method performs best in all indicators. Compared with the best SDI-SOD method, the proposed method shows significant improvement. α ,M, and In terms of performance, the performance improvements were 0.31%, 0%, 0.39%, 0.42%, 0.5%, 0.2%, 0.5%, 0.94% and 0.75% respectively. The indicators are particularly prominent.

[0157] Table 1 Quantitative performance comparison of 10 state-of-the-art methods

[0158]

[0159] Among them, the direction of the arrow indicates a higher or lower score, CN. represents the NSI-SOD method based on CNN, CR. represents the RSI-SOD method based on CNN, and CS. does not represent the SDI-SOD method based on CNN.

[0160] This paper conducts comprehensive experiments to evaluate the effectiveness of the key components of AMSFF-Net on the Focused-Defect-Detection-Tiles dataset. This paper uses the S α ,M, and AMSFF-Net and related architectures are quantitatively evaluated.

[0161] In this study, in order to verify the importance of key components in the network architecture, a series of control experiments were conducted to remove each technology used in the model one by one, that is, the baseline configuration B shown in Table 2. The baseline of the experimental results is shown in the first row of the table. Through comparative analysis, this paper pays special attention to the changes in model performance under different configurations. The results show that when only random rotation or aspect ratio adjustment is applied, the performance improvement is almost negligible, indicating that the contribution of these two technologies to the overall performance when used alone is limited. Nevertheless, the record of this finding is of great significance for understanding the role of each technology in a specific environment and their interaction. In particular, in practical application scenarios, even a small performance improvement may have a significant impact on the final effect of the task. Therefore, although this part of the experiment shows limited performance improvement, it is of key value in revealing the relative importance and potential complementary role of each component in the model.

[0162] After the introduction of the AMSFF component, the model performance is improved more significantly. Compared with the baseline B, AMSFF-Net has a higher performance in S α ,M, and The improvements were 0.56%, 0%, 0.76%, and 1.67% respectively. This result not only verifies the effectiveness of AMSFF, but also emphasizes the optimization potential of the model when considering multiple technologies.

[0163] Table 2 Contribution evaluation and elimination study of each module in ASMFF-Net

[0164]

[0165]

[0166] The object surface defect detection device provided by the present invention is described below. The object surface defect detection device described below and the surface defect salient target detection method based on adaptive multi-scale feature fusion described above can be referenced to each other.

[0167] like Figure 8 As shown, the device includes an extraction module 801, a weighting module 802, a fusion module 803 and a detection module 804, wherein:

[0168] The extraction module 801 is used to extract multiple levels of feature maps from the surface image of the object to be detected using the VGG16 network;

[0169] The weighting module 802 is used to weight the feature maps of each level through spatial and channel attention using the CBAM attention mechanism;

[0170] The fusion module 803 is used to use an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow;

[0171] A detection module, used for predicting the defect area in the surface image of the object to be detected according to the fusion result of the feature map;

[0172] The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism;

[0173] The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight;

[0174] The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature;

[0175] The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

[0176] This embodiment proposes a novel adaptive multi-scale feature fusion network AMSFF-Net for object surface defect significant object detection. AMSFF-Net is divided into adaptive weight fusion, global feature adaptive fusion and differential feature adaptive fusion. The adaptive weight fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the global feature adaptive fusion can dynamically adjust the weight according to the importance of the feature, thereby improving the effect of feature fusion; the differential feature adaptive fusion mechanism can effectively capture the differences between different features and enhance the expressiveness of the features, thereby improving the accuracy of object surface defect detection, and has strong robustness and generalization ability.

[0177] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute a surface defect salient target detection method based on adaptive multi-scale feature fusion, the method comprising: extracting multiple levels of feature maps from the surface image of the object to be detected using a VGG16 network; weighting the feature maps of each level through spatial and channel attention using a CBAM attention mechanism; gradually fusing the weighted feature maps in a hierarchical order from deep to shallow using an adaptive multi-scale feature fusion strategy; and predicting the defect area in the surface image of the object to be detected according to the fusion result of the feature maps.

[0178] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0179] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the surface defect significant target detection method based on adaptive multi-scale feature fusion provided by the above methods, and the method includes: using a VGG16 network to extract feature maps of multiple levels from the surface image of the object to be detected; using a CBAM attention mechanism to weight the feature maps of each level through spatial and channel attention; using an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow; and predicting the defect area in the surface image of the object to be detected based on the fusion result of the feature maps.

[0180] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the surface defect significant target detection method based on adaptive multi-scale feature fusion provided by the above-mentioned methods, the method comprising: using a VGG16 network to extract feature maps of multiple levels from the surface image of the object to be detected; using a CBAM attention mechanism to weight the feature maps of each level through spatial and channel attention; using an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow; and predicting the defect area in the surface image of the object to be detected based on the fusion result of the feature maps.

[0181] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A surface defect salient target detection method based on adaptive multi-scale feature fusion, characterized in that: include: Use the VGG16 network to extract multiple levels of feature maps from the surface image of the object to be detected; Use the CBAM attention mechanism to weight the feature maps of each level through spatial and channel attention; Using an adaptive multi-scale feature fusion strategy, the weighted feature maps are gradually fused in a hierarchical order from deep to shallow; Predicting defect areas in the surface image of the object to be detected according to the fusion result of the feature map; The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism; The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight; The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature; The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

2. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to claim 1 is characterized in that: The weighted feature maps are gradually fused in a hierarchical order from deep to shallow using the adaptive weight fusion mechanism in the adaptive multi-scale feature fusion strategy, including: The weighted current feature map and the previous fusion result are convolved and added to generate a combined feature map. Use the convolution layer with Sigmoid activation function to calculate the weighted convolution weights of the current feature map, the previous fusion result, and the combined feature map. Use the spatial attention mechanism to calculate the weighted attention weights of the current feature map, the previous fusion result, and the combined feature map; After multiplying the convolution weights of the weighted current feature map, the previous fusion result and the combined feature map with the corresponding attention weights, the weighted current feature map, the previous fusion result and the combined feature map are weighted fused.

3. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to claim 2 is characterized in that: The step of multiplying the weighted current feature map, the previous fusion result, and the convolution weight of the combined feature map by the corresponding attention weight includes: The weighted current feature map, the previous fusion result, and the convolution weight of the combined feature map are added together to obtain the total weight; Calculate the ratio of the weighted convolution weights of the current feature map, the previous fusion result and the combined feature map to the total weight; Multiply the weighted ratio of the current feature map, the previous fusion result, and the combined feature map by the corresponding attention weight.

4. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to claim 1 is characterized in that: The weighted feature maps are gradually fused in a hierarchical order from deep to shallow using the global feature adaptive fusion mechanism in the adaptive multi-scale feature fusion strategy, including: After concatenating the weighted current feature map with the previous fusion result, the convolutional layer is used to process it to obtain a new feature map. The new feature map is processed using global average pooling and Sigmoid function in sequence to obtain an adaptive weight of the global feature; The weighted current feature map, the previous fusion result and the weighted fusion result output by the adaptive weight fusion mechanism are multiplied by the adaptive weight of the global feature respectively and then fused.

5. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to claim 1 is characterized in that: The method of using the difference feature adaptive fusion mechanism in the adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow includes: The weighted current feature map and the previous fusion result are concatenated to obtain a fused feature map; Calculating the difference feature between the fused feature map and the feature after global average pooling of the fused feature map; Calculate the adaptive weight of the difference feature using Sigmoid function; The fused feature map is updated according to the adaptive weights of the difference features.

6. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to any one of claims 1 to 5, characterized in that: Before the adaptive multi-scale feature fusion strategy is used to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow, the method further includes: Multi-scale feature fusion and global autocorrelation processing are performed on the deepest feature map.

7. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to any one of claims 1 to 5, characterized in that: Before extracting multiple levels of feature maps from the surface image of the object to be detected using the VGG16 network, the method further includes: Preprocessing the data set, wherein the preprocessing includes one or more of removing negative samples, uneven samples, random rotation, and adjusting the aspect ratio; Using the preprocessed dataset, the VGG16 network, CBAM attention mechanism and adaptive multi-scale feature fusion strategy are trained and performance evaluated as a whole.

8. The surface defect salient target detection method based on adaptive multi-scale feature fusion according to claim 7 is characterized in that: Adjust the aspect ratio of the dataset by following these steps: Calculating a scaling ratio of the sample so that the long side of the sample in the data set matches the long side in the target size, or the short side of the sample matches the short side in the target size; Proportionally scaling the sample according to the scaling ratio; If the size of the sample after proportional scaling is inconsistent with the target size, a blank area is filled around the sample after proportional scaling to make the size of the sample consistent with the target size.

9. A surface defect salient target detection device based on adaptive multi-scale feature fusion, characterized in that: include: An extraction module is used to extract feature maps of multiple levels from the surface image of the object to be detected using the VGG16 network; A weighting module is used to weight the feature maps of each level through spatial and channel attention using the CBAM attention mechanism; A fusion module, used to use an adaptive multi-scale feature fusion strategy to gradually fuse the weighted feature maps in a hierarchical order from deep to shallow; A detection module, used for predicting the defect area in the surface image of the object to be detected according to the fusion result of the feature map; The adaptive multi-scale feature fusion strategy includes an adaptive weight fusion mechanism, a global feature adaptive fusion mechanism and a difference feature adaptive fusion mechanism; The adaptive weight fusion mechanism is used to calculate the weight of the weighted current feature map and the previous fusion result, and fuse the weighted current feature map and the previous fusion result according to the weight; The global feature adaptive fusion mechanism is used to splice the weighted current feature map and the previous fusion result, and then use global average pooling and Sigmoid function to process them in turn to obtain the adaptive weight of the global feature, and fuse the weighted current feature map and the previous fusion result according to the adaptive weight of the global feature; The difference feature adaptive fusion mechanism is used to obtain a fused feature map by splicing the weighted current feature map and the previous fusion result, calculate the difference features between the fused feature map and the features after global average pooling of the fused feature map, and optimize the fused feature map according to the difference features.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the surface defect salient target detection method based on adaptive multi-scale feature fusion as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Printed circuit board surface defect detection method and device based on deformable fusion channel position attention and multi-scale adaptive feature fusion

    CN120997178A

  • A printed circuit board surface defect detection method and device based on deformable fusion channel position attention and multi-scale adaptive feature fusion

    CN120997178B

  • Sectional material back-spraying defect detection method and system

    CN122391236A

  • A profile back-spraying defect detection method and system

    CN122391236B