Surface detection method based on feature selection and parallel interactive attention mechanism

By employing feature selection and parallel interactive attention mechanisms through DFS and PIA modules, the problems of feature redundancy, insufficient multi-scale fusion, and inadequate utilization of spatial context in surface detection are solved, thereby improving detection accuracy and efficiency. This approach is suitable for identifying minute defects in industrial products.

CN121982011APending Publication Date: 2026-05-05ANHUI UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI UNIVERSITY OF TECHNOLOGY
Filing Date
2026-02-02
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing surface detection methods have shortcomings in terms of defect localization accuracy and detection rate of minute defects. Feature redundancy leads to waste of computational resources, insufficient multi-scale information fusion, and inadequate utilization of spatial context information, which affect the model's detection performance in abnormal areas.

Method used

A method based on feature selection and parallel interactive attention mechanism is adopted. The DFS module is used to select the feature channels most sensitive to defects, and the PIA module is used for multi-scale feature enhancement. By combining global context and local detail information, the feature fusion is optimized and the computational efficiency is improved.

Benefits of technology

It significantly improves the accuracy of defect detection and segmentation, enhances the detection capability for minute defects and complex texture backgrounds, reduces computational complexity, and enhances the model's generalization ability and computational efficiency, making it suitable for resource-constrained industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121982011A_ABST
    Figure CN121982011A_ABST
Patent Text Reader

Abstract

The invention discloses a surface detection method based on feature selection and a parallel interactive attention mechanism, and belongs to the technical field of image detection. Comprising the following steps that 1, a feature map needing to be detected is sent to a DFS module, the DFS module screens out a feature channel subset most sensitive to abnormity, then the feature channel subset is mapped to a unified space through a feature adapter, dimensionality reduction is conducted, and an adaptive feature map is obtained; 2, the adaptive feature map is sent to a PIA module, the PIA module processes the adaptive feature map through a global context branch and a local detail branch, then outputs of the global context branch and the local detail branch interact, and finally an enhanced feature map is output through residual connection; and 3, testing the enhanced feature map by adopting an exception decision technology to obtain an exception detection result. According to the method, a channel more sensitive to defects can be found, multi-scale feature enhancement is realized, and the spatial perception capability of the model to an abnormal region is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image detection technology, and more specifically, relates to a surface detection method based on feature selection and parallel interactive attention mechanism. Background Technology

[0002] Surface detection is a technique for identifying and precisely locating anomalous regions on the surface of an object. Compared to traditional image processing methods, surface defect detection methods based on deep convolutional neural networks have achieved more competitive performance advantages. Because small defects are easily masked by background noise in surface defect detection tasks, it is necessary to extract more fine-grained feature information to detect them. General convolutional modules typically extract more local feature information at a single scale, making them unsuitable for detecting complex defect types and resulting in poor performance in terms of defect localization accuracy and the detection rate of small defects.

[0003] Currently, in the field of surface inspection, deep learning-based methods have made significant progress in improving defect localization accuracy and the detection rate of minute defects. However, existing feature extraction methods still suffer from insufficient multi-scale information fusion when facing complex industrial scenarios. To address this issue, PANet (Path Aggregation Network) was proposed. PANet adds bottom-up enhancement paths to FPN (Feature Pyramid Network), forming a bidirectional pyramid structure to achieve more comprehensive multi-scale feature fusion. Furthermore, SCANet (Spatial-Channel Attention Network) was proposed, using multi-layer attention mechanisms and feature recalibration to address the problem of low contrast between defects and background. Recently, DCNv4-ADet (Deformable Convolution v4 + Adaptive Attention) was proposed, aiming to solve the localization ambiguity problem caused by the diversity of defect morphologies by adapting deformable convolution v4 to arbitrary defect boundaries and dynamically adjusting the receptive field to cope with scale changes.

[0004] However, despite the significant progress these technologies have made in surface detection tasks, they also have some shortcomings, including the following issues: (1) Feature redundancy leads to insufficient accuracy in defect localization: Traditional methods use all feature channels, resulting in 95% of computational resources and time being wasted on processing redundant and noisy information, and there are significant differences in the feature response intensity of different channels. Some redundant feature channels will produce excessively strong activation responses, while some key features that are sensitive to anomalies are often submerged in background noise. This imbalance in feature response seriously affects the model's ability to perceive subtle anomaly patterns. (2) Insufficient multi-scale information fusion: Industrial defects often exhibit multi-scale characteristics, including both macroscopic structural anomalies and microscopic texture defects. Existing methods usually use simple splicing or addition operations when fusing feature information at different scales, lacking in-depth mining of semantic relationships between cross-scale features; resulting in poor multi-scale collaborative detection performance. (3) Insufficient utilization of spatial context information: Anomaly detection tasks have high requirements for the spatial distribution relationship of features. Traditional methods, when processing feature maps, fail to adequately model the correlation between spatial locations and cannot effectively establish the connection between local features and the global context, thus affecting the model's accurate localization of abnormal regions. Summary of the Invention

[0005] 1. The problem to be solved To address the numerous shortcomings of existing surface detection technologies, this invention provides a surface detection method based on feature selection and parallel interactive attention mechanisms. By utilizing DFS and PIA modules, it can identify channels that are more sensitive to defects, achieve multi-scale feature enhancement, and improve the model's spatial perception capability of abnormal regions.

[0006] 2. Technical Solution To solve the above problems, the present invention adopts the following technical solution.

[0007] A surface detection method based on feature selection and parallel interactive attention mechanism includes the following steps: First, the feature map to be detected is sent to the DFS module. The DFS module selects the subset of feature channels that are most sensitive to anomalies, and then maps the subset of feature channels to a unified space through the feature adapter and performs dimensionality reduction to obtain the adapted feature map. 2. The adapted feature map is fed into the PIA module. The PIA module processes the adapted feature map through the global context branch and the local detail branch respectively. Then, the outputs of the global context branch and the local detail branch interact, and finally the enhanced feature map is output through the residual connection. Third, anomaly detection results were obtained by experimenting with the enhanced feature map using anomaly decision-making techniques.

[0008] Furthermore, in step one, before the feature map is fed into the DFS module, a multi-scale feature map is extracted through a backbone network pre-trained on ImageNet. Furthermore, the DFS module filters feature channel subsets in the following three stages: (1) In the module initialization phase, preparations are made for feature selection based on the predefined structure; (2) Index initialization process: Before training begins, the most effective channel in each feature block is evaluated and selected; (3) In the forward propagation process, pre-computed indexes are used to efficiently construct multi-scale features.

[0009] Furthermore, the specific process of the module initialization phase is as follows: Read and parse the module's structure definition, which specifies how to construct feature blocks from different levels; create trainable index parameters for each layer in each feature block to store the selected channel index; register a corresponding upsampling module for each feature layer to unify the features to the target scale.

[0010] Furthermore, the specific process of index initialization is as follows: For each feature layer l, calculate the difference between abnormal features and normal features: ; in, B represents the batch size, C represents the number of channels, and H and W represent the spatial dimensions. This represents the feature map of a normal image. This represents the feature map of the abnormal image.

[0011] Then the difference map is reshaped and subjected to min-max normalization channel by channel: ; in, It is a very small number to prevent division by zero errors. This represents the normalized feature difference value of the c-th channel. Min( represents the original feature difference value of the c-th channel) ) represents the minimum value of all pixel values ​​in the c-th channel, max( () represents the maximum value of all pixels in the c-th channel; Next, the binarized true anomaly mask is... Upsampling with Same size, and reshaped into Then copy it C times along the channel dimension to obtain Finally, the MSE loss for each channel c is calculated: ; Finally, after accumulating the losses from multiple batches, select the K channels with the smallest losses: ; ; in, This represents the cumulative loss of all channels in layer l, k represents the number of channels to select, values ​​represents the k minimum loss values ​​to select, and indices represents the corresponding channel index. It is stored for later use.

[0012] Furthermore, the specific process of forward propagation is as follows: Channel selection: ; in, This represents the original feature map of layer l. This represents the selected features of the l-th layer. This represents the set of channel indices for the l-th layer, where dim=1 indicates selection within the channel dimension (the first dimension, 0-based index). Feature upsampling: ; in, This represents the bicubic interpolation function of the l-th layer. Represents the upsampling scale factor of the l-th layer, model= This indicates that the bicubic interpolation mode was used; Feature fusion: ; in, Indicates the first The features after upsampling at each layer, where `cancat` represents the concatenation operation. This represents the feature block that is ultimately fused.

[0013] Furthermore, the adaptation feature map received by the PIA module Where B is the batch size, C is the number of channels, and H and W are the feature map height and width; then the channel dimensions are divided into G groups and reshaped into batch dimensions: .

[0014] Furthermore, the global context branch adopts The branching process for handling the adaptation feature map is as follows: This branch generates orientation-aware channel attention weights to capture global contextual information, divided into horizontal and vertical directions. The horizontal direction is compressed along the width dimension, as shown in the formula: ; in, This represents an adaptive two-dimensional average pooling operation. This indicates a height of H and a width of 1. This represents the result of global pooling in the horizontal direction; The formula for compression along the high latitudes in the vertical direction is: ; in, This represents the result of global pooling in the vertical direction, where (1, w) represents a height of 1 and a width of w. Then, the features from both directions are concatenated and used. Convolutional fusion: ; in, Indicates 1 1. One-dimensional convolution; Furthermore, global attention weights are generated using the Sigmoid activation function: ; in, This represents the compressed global semantic features. This represents the activation function. This represents the global attention weight.

[0015] Furthermore, local detail branches are adopted The branching process for handling the adaptation feature map is as follows: Depthwise molecular convolution: ; in, It means Depthwise separable convolution, where L represents local detail features; Local feature activation: ; in, This represents the local attention weight.

[0016] Furthermore, the process of enabling the outputs of the global context branch and the local detail branch to interact, and finally outputting the enhanced feature map through residual connections, is as follows: Cross-branch interaction is achieved by using matrix multiplication to convert the outputs of the global context branch and the local detail branch: ; Where d is the scaling factor, usually taken as d = C / G. represents the local feature matrix after transpose, and Softmax represents the normalization exponential function; Then the attention weights are applied to the local features: ; Where Attention represents the global-local correlation matrix, This represents the weighted characteristic matrix; Reshape the weighted features back to the original spatial dimensions: ; in, This represents the enhanced grouping features; Restore the original batch and channel dimensions: ; The final output via residual connections contains both the original information and enhanced features: ; This represents the final enhanced feature map.

[0017] 3. Beneficial effects Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention provides a surface detection method based on feature selection and parallel interactive attention mechanism, which effectively improves the accuracy of defect detection and segmentation. Through the synergistic effect of parallel interactive attention mechanism (PIA) and feature selection (DFS) module, a precision processing pipeline of "screening-enhancement" is constructed, which significantly improves the detection accuracy of small defects on the surface of industrial products and defects in complex texture background, especially the ability to identify irregular shapes and weak defects. (2) The present invention provides a surface detection method based on feature selection and parallel interactive attention mechanism, which realizes the optimized fusion of global and local features. The innovative network structure combines DFS feature selection and PIA parallel interactive attention module, enabling the network to adaptively select the most discriminative feature channel, while effectively fusing global context information and local detail features, and comprehensively improving the feature representation capability of the model. (3) The present invention provides a surface detection method based on feature selection and parallel interactive attention mechanism, which significantly improves computational efficiency. The channel filtering mechanism of the DFS module greatly reduces feature redundancy. Combined with lightweight design such as group processing and depth-separable convolution in the PIA module, the computational complexity is significantly reduced while maintaining detection accuracy, thereby improving the speed and efficiency of the model in processing high-resolution industrial images. (4) The present invention provides a surface detection method based on feature selection and parallel interactive attention mechanism, which enhances the generalization ability of the model. The improved network structure better integrates multi-scale feature information through adaptive feature selection and cross-space attention mechanism, enhances the adaptability to different industrial scenarios and defect types, and maintains stable detection performance under challenging conditions such as light changes and complex backgrounds. (5) The present invention provides a surface detection method based on feature selection and parallel interactive attention mechanism. Through feature channel optimization of the DFS module and efficient attention mechanism of the PIA module, the computational overhead and memory ratio of the model are greatly reduced, enabling efficient and real-time defect detection in industrial environments with limited resources such as embedded devices and edge computing. Attached Figure Description

[0018] Figure 1 This is an example diagram of the model structure provided by the present invention.

[0019] Figure 2 A schematic diagram of the DFS technology for the model provided in this invention.

[0020] Figure 3 A schematic diagram of PIA technology for the model provided by this invention.

[0021] Figure 4 The present invention provides sampled images, ground truth labels, and anomaly maps for each category of MVTec AD.

[0022] Figure 5 An anomaly visualization diagram provided by this invention. Detailed Implementation

[0023] Exemplary embodiments of the present invention are described in detail below. While these exemplary embodiments have been described in sufficient detail to enable those skilled in the art to practice the invention, it should be understood that other embodiments may be implemented and various changes may be made to the invention without departing from its spirit and scope. The more detailed description of embodiments of the invention below is not intended to limit the scope of the claimed invention, but is merely illustrative and does not limit the description of the features and characteristics of the invention, in order to suggest the best mode for carrying out the invention and to enable those skilled in the art to practice it. Therefore, the scope of the invention is defined only by the appended claims.

[0024] Example 1 A surface detection method based on feature selection and parallel interactive attention mechanism, such as Figure 1 As shown, the entire model's workflow can be divided into the following three stages.

[0025] First, the model receives an image. Then, a multi-scale feature map is extracted through a backbone network (WideResNet-50) pre-trained on ImageNet. These feature maps contain rich information from low-level texture to high-level semantics, but there is a lot of redundancy.

[0026] Therefore, the extracted multi-scale feature maps need to be fed into the DFS module, such as... Figure 2 As shown, DFS is a feature selection module. Its core idea is to select the most sensitive channels to anomalies for each feature block through an offline, data-driven initialization process. During inference, only these selected channels are used, thus achieving efficient computation. The DFS module's selection of a subset of feature channels includes the following three stages: (1) Module initialization phase Based on the predefined structure, preparations are made for feature selection. The specific process is as follows: read and parse the module's structure definition, which specifies how to construct feature blocks from different levels; create trainable index parameters for each layer in each feature block to store the selected channel index; and register a corresponding upsampling module for each feature layer to unify the features to the target scale.

[0027] (2) Index initialization process Before training begins, the most effective channel in each feature block is evaluated and selected. For each feature layer l, the difference between abnormal and normal features is calculated: ; in, B represents the batch size, C represents the number of channels, and H and W represent the spatial dimensions. This represents the feature map of a normal image. This represents the feature map of the abnormal image.

[0028] Then the difference map is reshaped and subjected to min-max normalization channel by channel: ; in, It is a very small number to prevent division by zero errors. This represents the normalized feature difference value of the c-th channel. Min( represents the original feature difference value of the c-th channel) ) represents the minimum value of all pixel values ​​in the c-th channel, max( ) represents the maximum value of all pixels in the c-th channel.

[0029] Next, the binarized true anomaly mask is... Upsampling with Same size, and reshaped into Then copy it C times along the channel dimension to obtain Finally, the MSE loss for each channel c is calculated: ; Finally, after accumulating the losses from multiple batches, select the K channels with the smallest losses: ; ; in, This represents the cumulative loss of all channels in layer l, k represents the number of channels to select, values ​​represents the k minimum loss values ​​to select, and indices represents the corresponding channel index. It is stored for later use.

[0030] (3) Forward propagation process Efficiently construct multi-scale features using pre-computed indexes.

[0031] Channel selection: ; in, This represents the original feature map of layer l. This represents the selected features of the l-th layer. This represents the set of channel indices for the l-th layer. dim=1 indicates selection in the channel dimension (the first dimension, 0-based index).

[0032] Feature upsampling: ; in, This represents the bicubic interpolation function of the l-th layer. Represents the upsampling scale factor of the l-th layer, model= This indicates that bicubic interpolation was used. Bicubic interpolation upsampling offers advantages over the original bilinear interpolation upsampling in three main aspects: First, it uses cubic spline interpolation with 16 neighboring points instead of the 4-point linear interpolation of bilinear interpolation, better preserving the clarity of feature edges and structural integrity, especially with less quality degradation at large upsampling magnifications such as 4x and 8x. Second, in defect detection tasks, bicubic interpolation improves the detection rate of small defects, increases positioning accuracy, reduces jagged edges and blur artifacts, and makes defect boundaries more precise. Finally, although the computational complexity increases by approximately four times, the actual inference time does not increase significantly because the DFS module greatly reduces the amount of feature data through intelligent channel selection, making it more suitable for industrial scenarios with high detection accuracy requirements.

[0033] Feature fusion: ; in, Indicates the first The features after upsampling at each layer, where `cancat` represents the concatenation operation. This represents the feature block that is ultimately fused.

[0034] The DFS module automatically selects the subset of channels most sensitive to anomalies, discarding redundant and weakly discriminative channels, providing a high-quality, highly discriminative feature set for subsequent processing, while significantly reducing computational complexity. The selected feature subset is then processed through a feature adapter (typically...). Convolution maps features to a unified latent space and reduces dimensionality to obtain a suitable feature map. This unified the feature scale and prepared the ground for subsequent attention enhancement.

[0035] II. Adaptation Feature Map Send it to the PIA module, such as Figure 3 As shown, the core design of the PIA module is to enhance feature representation through a grouped parallel structure and cross-space learning. First, it receives feature maps from the feature adapter. Where B is the batch size, C is the number of channels, and H and W are the feature map height and width. Then, the channel dimensions are divided into G groups and reshaped into batch dimensions: .

[0036] This step converts the original features into G independent sub-feature maps, and then performs parallel branching processing on the processed features.

[0037] Among them, the global context branch adopts The branching process for handling the adaptation feature map is as follows: This branch generates orientation-aware channel attention weights to capture global contextual information, divided into horizontal and vertical directions. The horizontal direction is compressed along the width dimension, as shown in the formula: ; in, This represents an adaptive two-dimensional average pooling operation. This indicates a height of H and a width of 1. This represents the result of global pooling in the horizontal direction.

[0038] The formula for compression along the high latitudes in the vertical direction is: ; in, This represents the result of global pooling in the vertical direction, where (1, w) represents a height of 1 and a width of w.

[0039] Then, the features from both directions are concatenated and used. Convolutional fusion: ; in, Indicates 1 1. One-dimensional convolution.

[0040] Furthermore, global attention weights are generated using the Sigmoid activation function: ; in, This represents the compressed global semantic features. This represents the activation function. This represents the global attention weight.

[0041] Local detail branches are used The branching process for handling the adaptation feature map is as follows: Depthwise molecular convolution: ; in, It means Depthwise separable convolution, where L represents local detail features.

[0042] Local feature activation: ; in, This represents the local attention weight.

[0043] Cross-branch interaction is achieved by using matrix multiplication to convert the outputs of the global context branch and the local detail branch: ; Where d is the scaling factor, usually taken as d = C / G. represents the local feature matrix after transpose, and Softmax represents the normalization exponential function.

[0044] Then the attention weights are applied to the local features: ; Where Attention represents the global-local correlation matrix, This represents the weighted characteristic matrix.

[0045] Reshape the weighted features back to the original spatial dimensions: ; in, This represents the enhanced grouping features.

[0046] Restore the original batch and channel dimensions: ; The final output via residual connections contains both the original information and enhanced features: ; This represents the final enhanced feature map.

[0047] Third, anomaly detection results were obtained by experimenting with the enhanced feature map using anomaly decision-making techniques.

[0048] This stage has two branching modes: training mode and inference mode. During training, in order to learn the boundaries between normal and abnormal, the model will enhance features. Injecting Gaussian noise to generate synthetic anomalous features In inference mode, this step is bypassed, and enhanced features are used directly. Features (during training) During reasoning The image is then sent to the anomaly decision module. At this point, the segmentation head outputs a pixel-level anomaly mask. The system identifies suspicious areas and outputs an image-level anomaly score *s*, representing the overall confidence that the entire image is anomalous. (Mask) This is the final segmentation result, and the score s is used for image classification.

[0049] This phase selected MVTec AD as the dataset, an authoritative benchmark dataset for industrial anomaly detection released by MVTec Software GmbH. This dataset contains images of objects and textures across 15 categories, covering 5 object categories (e.g., transistors, screws, pills) and 5 texture categories (e.g., carpets, leather, tiles). Each class includes training and test sets. The training set consists only of normal samples, while the test set includes both normal samples and anomaly samples of various defect types. All anomaly samples are accompanied by finely annotated pixel masks. The images in the dataset were collected in controlled industrial environments and contain realistic defect types such as scratches, dents, contamination, and structural defects. In model evaluation, image-level AUROC, pixel-level AUROC, and AUPRO metrics are typically used to measure the model's ability to detect anomalies at the image level and its accuracy in locating defect regions at the pixel level, respectively. This dataset, through a rigorous unsupervised learning configuration (trained only using normal samples), has advanced the field of industrial anomaly inspection and become a standard benchmark for evaluating algorithm performance in this area. Figure 4 An example of this dataset is shown.

[0050] The model described above was trained on the MVTec AD dataset. All input images were processed using the ImageNet normalization method, and 256 were used. Images are 256 pixels in size and without center cropping. Training is performed using the AdamW optimizer for 300 epochs with a batch size of 8. The learning rate of the adapter module is set to... Both the segmentation head and the classification head adopt Set the learning rate and configure it. Weight decay. A learning rate scheduler is used to improve training stability, multiplying the learning rate by 0.4 after 240 and 270 training epochs, respectively. Furthermore, Gaussian noise samples are added to generate anomalous features, taken from... ,in =0.015. For the MVTec AD algorithm, Perlin noise is binarized with a threshold of 0.2 to generate finer anomaly features.

[0051] The experimental results of the model on the MVTec AD dataset are shown in Table 1, and the sample anomaly visualization is shown in the figure below. Figure 5 As shown.

[0052]

[0053] Table 1. Anomaly detection and localization capabilities of the model on the MVTec AD dataset (AUROC / AUPRO) In summary, the surface detection method based on feature selection and parallel interactive attention mechanism in this embodiment can find channels that are more sensitive to defects by using DFS and PIA modules, realize multi-scale feature enhancement, and enhance the model's spatial perception ability of abnormal regions.

[0054] The examples described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention.

Claims

1. A surface detection method based on feature selection and parallel interactive attention mechanism, characterized in that, Includes the following steps: First, the feature map to be detected is sent to the DFS module. The DFS module selects the subset of feature channels that are most sensitive to anomalies, and then maps the subset of feature channels to a unified space through the feature adapter and performs dimensionality reduction to obtain the adapted feature map.

2. The adapted feature map is fed into the PIA module. The PIA module processes the adapted feature map through the global context branch and the local detail branch respectively. Then, the outputs of the global context branch and the local detail branch interact, and finally the enhanced feature map is output through the residual connection. Third, anomaly detection results were obtained by experimenting with the enhanced feature map using anomaly decision-making techniques.

2. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 1, characterized in that: In step one, before the feature map is fed into the DFS module, a multi-scale feature map is extracted through a backbone network pre-trained on ImageNet.

3. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 2, characterized in that: The DFS module filters feature channel subsets in the following three stages: (1) In the module initialization phase, preparations are made for feature selection based on the predefined structure; (2) Index initialization process: Before training begins, the most effective channel in each feature block is evaluated and selected; (3) In the forward propagation process, pre-computed indexes are used to efficiently construct multi-scale features.

4. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 3, characterized in that: The specific process of the module initialization phase is as follows: Read and parse the module's structure definition, which specifies how to construct feature blocks from different levels; create trainable index parameters for each layer in each feature block to store the selected channel index; register a corresponding upsampling module for each feature layer to unify the features to the target scale.

5. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 4, characterized in that: The specific process of index initialization is as follows: For each feature layer l, calculate the difference between abnormal features and normal features: ; in, B represents the batch size, C represents the number of channels, and H and W represent the spatial dimensions. This represents the feature map of a normal image. This represents the feature map of the abnormal image; Then the difference map is reshaped and subjected to min-max normalization channel by channel: ; in, It is a very small number to prevent division by zero errors. This represents the normalized feature difference value of the c-th channel. Min( represents the original feature difference value of the c-th channel) ) represents the minimum value of all pixel values ​​in the c-th channel, max( () represents the maximum value of all pixels in the c-th channel; Next, the binarized true anomaly mask is... Upsampling with Same size, and reshaped into Then copy it C times along the channel dimension to obtain Finally, the MSE loss for each channel c is calculated: ; Finally, after accumulating the losses from multiple batches, select the K channels with the smallest losses: ; ; in, This represents the cumulative loss of all channels in layer l, k represents the number of channels to select, values ​​represents the k minimum loss values ​​to select, and indices represents the corresponding channel index. It is stored for later use.

6. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 5, characterized in that: The specific process of forward propagation is as follows: Channel selection: ; in, This represents the original feature map of layer l. This represents the selected features of the l-th layer. This represents the set of channel indices for the l-th layer, where dim=1 indicates selection within the channel dimension (the first dimension, 0-based index). Feature upsampling: ; in, This represents the bicubic interpolation function of the l-th layer. Represents the upsampling scale factor of the l-th layer, model= This indicates that the bicubic interpolation mode was used; Feature fusion: ; in, Indicates the first The features after upsampling at each layer, where `cancat` represents the concatenation operation. This represents the feature block that is ultimately fused.

7. A surface detection method based on feature selection and parallel interactive attention mechanism according to claim 1, characterized in that: The adaptation feature map received by the PIA module Where B is the batch size, C is the number of channels, and H and W are the feature map height and width; then the channel dimensions are divided into G groups and reshaped into batch dimensions: 。 8. The surface detection method based on feature selection and parallel interactive attention mechanism according to claim 7, characterized in that: Global context branching The branching process for handling the adaptation feature map is as follows: This branch generates orientation-aware channel attention weights to capture global contextual information, divided into horizontal and vertical directions. The horizontal direction is compressed along the width dimension, as shown in the formula: ; in, This represents an adaptive two-dimensional average pooling operation. This indicates a height of H and a width of 1. This represents the result of global pooling in the horizontal direction; The formula for compression along the high latitudes in the vertical direction is: ; in, This represents the result of global pooling in the vertical direction, where (1, w) represents a height of 1 and a width of w. Then, the features from both directions are concatenated and used. Convolutional fusion: ; in, Indicates 1 1. One-dimensional convolution; Furthermore, global attention weights are generated using the Sigmoid activation function: ; in, This represents the compressed global semantic features. This represents the activation function. This represents the global attention weight.

9. A surface detection method based on feature selection and parallel interactive attention mechanism according to claim 8, characterized in that: Local detail branches are used The branching process for handling the adaptation feature map is as follows: Depthwise molecular convolution: ; in, It means Depthwise separable convolution, where L represents local detail features; Local feature activation: ; in, This represents the local attention weight.

10. A surface detection method based on feature selection and parallel interactive attention mechanism according to claim 9, characterized in that: The process of enabling the outputs of the global context branch and the local detail branch to interact, and finally outputting the enhanced feature map through residual connections, is as follows: Cross-branch interaction is achieved by using matrix multiplication to convert the outputs of the global context branch and the local detail branch: ; Where d is the scaling factor, usually taken as d = C / G. represents the local feature matrix after transpose, and Softmax represents the normalization exponential function; Then the attention weights are applied to the local features: ; Where Attention represents the global-local correlation matrix, This represents the weighted characteristic matrix; Reshape the weighted features back to the original spatial dimensions: ; in, This represents the enhanced grouping features; Restore the original batch and channel dimensions: ; The final output via residual connections contains both the original information and enhanced features: ; This represents the final enhanced feature map.