Industrial inspection method based on improved YOLOv11 and time-space frequency domain attention
By inserting the KSFA module into the YOLOv11 model and combining spatiotemporal frequency domain attention and frequency domain filtering, the problems of high model computing power requirements and strong data dependence in industrial inspection solutions are solved, enabling efficient and accurate defect detection on edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU JINZHI HUMANOID ROBOT TECHNOLOGY CO LTD
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-17
AI Technical Summary
Existing industrial inspection solutions have high model computing power requirements, strong data dependence, and a prominent contradiction between speed and accuracy on industrial edge devices, making them prone to missing defects, especially when detecting minute defects.
An improved industrial inspection method using YOLOv11 and spatiotemporal frequency domain attention is adopted. By inserting a KSFA module into the YOLOv11 model, combining spatiotemporal reconstruction and frequency domain filtering, and using DCT basis function convolution kernels to reduce training parameters and computational load, and combining Ghost convolution and channel compression, the detection accuracy and speed are improved.
While reducing the number of model parameters and computational load, it improves detection accuracy, meets the real-time deployment requirements of industrial edge devices, reduces the amount of training data required, enhances the detection capability for small targets and fine-grained textures, and reduces the false negative rate.
Smart Images

Figure CN121883376A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and computer vision technology, specifically relating to an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention. Background Technology
[0002] In modern industrial production, product appearance defect detection and equipment condition inspection are crucial for ensuring quality. Traditional machine vision solutions often rely on a large number of manually designed features, resulting in poor adaptability. With the development of deep learning, object detection algorithms, represented by the YOLO (You Only Look Once) series, have been applied in industrial scenarios.
[0003] However, existing industrial inspection solutions still have the following pain points: High model computing power requirements: In order to pursue high accuracy, models often stack a large number of convolutional layers, resulting in a huge number of parameters, which makes it difficult to run in real time on industrial edge embedded devices with limited computing power (such as about 5 TOPS). Strong data dependence: Traditional convolutional neural networks (CNNs) are mainly based on spatial pixel feature learning, which is prone to overfitting. They require massive amounts of labeled data (tens of thousands of defect samples) to train a robust model, while defect sample collection is extremely difficult in industrial scenarios. The contradiction between speed and accuracy: Although the lightweight model is fast, it is prone to missing detection when faced with minor defects such as tiny scratches and foreign objects. To address this, we propose an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art, and to provide an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention.
[0005] This invention provides an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, comprising the following steps: S1: Acquire inspection video streams or continuous frame image data from the industrial site; S2: Construct a YOLOv11 target detection model based on KSFA improvement; S3: After converting the inspection video stream or the continuous frame image data into tensor form, input it into the improved YOLOv11 target detection model. The KSFA module in the YOLOv11 target detection model performs spatiotemporal reconstruction and frequency domain filtering on the input tensor and outputs the enhanced features of the tensor. S4: Perform multi-scale prediction based on the enhanced features, and output the category and location information of industrial defects or targets to be detected.
[0006] Further, in step S2, the KSFA-based improvement includes inserting at least one of the KSFA modules into the backbone feature extraction network or the neck network of the YOLOv11 feature extraction network.
[0007] Specifically, in step S3, the KSFA module performs the spatiotemporal reconstruction and frequency domain filtering on the input tensor as follows: A1: The KSFA module receives a shape of... The input tensor, where, T For time step or frame number, B For batch size, C For the number of channels, H and W For spatial dimensions; A2: The input tensor is divided into a temporal correlation branch and a spatial frequency domain branch for parallel processing; A3: The outputs of the temporal correlation branch and the spatial frequency domain branch are weighted and fused using the learning parameters to obtain the final output.
[0008] Specifically, in step A2, the processing of the time-series correlation branch includes the following steps: The input tensor is rearranged and then subjected to global average pooling and global max pooling, respectively. The results of two pooling methods are fused using learned parameters. By performing feature interaction in the time dimension through a fully connected layer, a temporal attention map for the time dimension is generated; After normalization using the Sigmoid activation function, the features of the input tensor at each time step are temporally weighted.
[0009] Preferably, in step A2, the processing of the spatial frequency domain branch includes the following steps: Initialize the discrete cosine transform filter bank based on a preset number of frequencies; Specific DCT basis functions are selected as convolution kernel weights according to the selection strategy, wherein the frequency selection strategy adopts one of full-frequency selection, single-frequency selection or Top-K frequency selection; The feature map of the input tensor after time-weighting is averaged in the time dimension, and the convolution operation is performed using the convolution kernel of the DCT basis function to extract frequency domain features. Spatial frequency attention maps for different frequency channels are generated through frequency attention convolutional layers, and the frequency domain features are spatially weighted.
[0010] Specifically, the KSFA module concentrates the texture and edge information of the industrial defect or the target to be detected onto the frequency component based on the energy concentration characteristics of the DCT basis function transformation. By using the DCT basis function convolution kernel with non-learning fixed weights, the number of training parameters and multiply-accumulate operations of the YOLOv11 target detection model are reduced.
[0011] Furthermore, in the YOLOv11 target detection model, at least one KSFA module is set to act on low-level high-resolution feature maps to enhance the detection capability of small targets and fine-grained textures; at least one KSFA module is set to act on high-level low-resolution feature maps to enhance the global semantic representation capability of targets in complex backgrounds.
[0012] Furthermore, the number of frequencies, the spatial resolution of the feature map, and the target size distribution are set according to the following rules: When the resolution of the input image is higher than the resolution threshold and the target size span is greater than the span threshold, the number of frequencies is set to a larger value to preserve the low-frequency global structure information and mid-to-high frequency texture details of the industrial defect or the target to be detected. When the resolution of the input image is lower than the preset resolution value or the target shape conforms to the simple shape standard, the number of frequencies is taken to reduce the computational load of the KSFA module and suppress the high-frequency noise of the industrial defects or the target data to be detected.
[0013] Furthermore, the frequency attention convolutional layer is implemented using a 1×1 convolution or a depthwise separable convolutional structure. The frequency attention coefficients output by the frequency attention convolutional layer are normalized by the Sigmoid or Softmax function and then multiplied channel by channel with the corresponding frequency domain features to achieve adaptive reweighting of features in different frequency bands.
[0014] Specifically, the improvements to the YOLOv11 object detection model also include: Replace some standard convolutions in the backbone feature extraction network or the feature fusion neck network with depthwise separable convolutions or Ghost convolutions to reduce redundant computation between feature map channels of the tensor; The number of channels for features at each scale in the feature pyramid network of the YOLOv11 target detection model is compressed, and combined with the spatiotemporal frequency domain feature enhancement capability of the KSFA module, the number of parameters and FLOPs of the YOLOv11 target detection model are reduced while maintaining detection accuracy.
[0015] The beneficial effects of this invention are as follows: By inserting a KSFA module into the YOLOv11 object detection model and employing a fixed-weight DCT basis function convolution kernel, the KSFA module introduces dual attention in the spatiotemporal and frequency domains while adding almost no trainable parameters. Combined with Ghost convolution and channel compression, the improved YOLOv11 model reduces the number of parameters and FLOPs by 25% to 35% compared to the original YOLOv11, meeting the real-time deployment requirements of industrial edge devices. The frequency domain features have strong anti-interference capabilities and generalization. Under the same detection effect, the amount of training data required by this method is only 30% to 50% of that of the conventional YOLOv8 / v11 model, greatly reducing the threshold for project implementation. Attached Figure Description
[0016] Figure 1 The flowchart illustrates the steps of an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, according to a specific embodiment of the present invention. Figure 2 The diagram shows the processing logic within the KSFA module of an industrial inspection method based on an improved YOLOv11 and spatiotemporal frequency domain attention, according to a specific embodiment of the present invention. Figure 3 The complete detection flowchart of an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention is shown in a specific embodiment of the present invention. Figure 4 This is a curve comparing the accuracy of an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, according to a specific embodiment of the present invention. Detailed Implementation
[0017] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0018] like Figure 1 As shown in the figure, a specific embodiment of the present invention provides an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, comprising the following steps: S1: Acquire inspection video streams or continuous frame image data from the industrial site; S2: Construct a YOLOv11 target detection model based on KSFA improvement; S3: After converting the inspection video stream or continuous frame image data into tensor form, input it into the improved YOLOv11 target detection model. The KSFA module in the YOLOv11 target detection model performs spatiotemporal reconstruction and frequency domain filtering on the input tensor and outputs the enhanced features of the tensor. S4: Perform multi-scale prediction based on enhanced features, and output the category and location information of industrial defects or targets to be detected.
[0019] Specifically, KSFA stands for Key-frame Spatio-Temporal Frequency Attention, a spatio-temporal frequency selective attention module designed for industrial inspection video sequences. It captures keyframe information in the temporal dimension (temporal correlation branch) and enhances high-frequency details such as texture, edges, and defects in the frequency dimension (spatial frequency branch). The two branches are learned in parallel and then weighted and fused to balance lightweight design and accuracy.
[0020] Furthermore, the YOLOv11 object detection model inherits the anchor-free, C2f / C3k structure of YOLOv8 or v10. The default backbone of this model is still a variant of CSPDarknet, but it has more efficient C3k and C2f modules. In addition, the Neck in this model adopts a PAN structure, and the detection head is a decoupled head. Compared with YOLOv8, YOLOv11 has a further reduction of 10%~15% in the number of parameters and FLOPs, and is faster. The Neck is a feature fusion network, and the backbone is the main feature extraction network.
[0021] Furthermore, in step S4, common categories of industrial inspections include cracks, scratches, rust, incomplete welds, pores, foreign objects, deformation, and missing materials.
[0022] Based on the above basic implementation, in step S2, the KSFA improvement includes inserting at least one KSFA module into the backbone feature extraction network or the neck network of the YOLOv11 feature extraction network.
[0023] Specifically, inserting a KSFA module into the backbone feature extraction network can introduce spatiotemporal frequency domain attention as early as possible, enhance the original feature expression ability, and make it more sensitive to small defects and weak textures; inserting a KSFA module into the feature fusion neck network can further enhance the multi-scale feature fusion stage and improve the semantic segmentation ability of large targets in complex backgrounds.
[0024] In one specific implementation, in step S3, the KSFA module performs spatiotemporal reconstruction and frequency domain filtering on the input tensor as follows: A1: The KSFA module receives a shape of... The input tensor, where, T For time step or frame number, B For batch size, C For the number of channels, H and W For spatial dimensions; A2: The input tensor is divided into a temporal correlation branch and a spatial frequency domain branch for parallel processing; A3: The outputs of the temporal correlation branch and the spatial frequency domain branch are weighted and fused using the learning parameters to obtain the final output.
[0025] In this embodiment, the processing of the time-series dependent branches in step A2 includes the following steps: The input tensors are rearranged and then subjected to global average pooling and global max pooling, respectively. The results of two pooling methods are fused using learned parameters. By using fully connected layers to perform feature interaction in the time dimension, a temporal attention map is generated for the time dimension. After normalization using the Sigmoid activation function, the features of the input tensor at each time step are temporally weighted.
[0026] Furthermore, in step A2, the processing of the spatial frequency domain branch includes the following steps: Initialize the discrete cosine transform filter bank based on a preset number of frequencies; Specific DCT basis functions are selected as convolution kernel weights according to the selection strategy. The frequency selection strategy can be one of full-frequency selection, single-frequency selection or Top-K frequency selection. The feature map of the time-weighted input tensor is averaged in the time dimension, and the frequency domain features are extracted by performing a convolution operation using the convolution kernel of the DCT basis function. Spatial frequency attention maps for different frequency channels are generated through frequency attention convolutional layers, and the frequency domain features are spatially weighted.
[0027] In another specific embodiment, the KSFA module concentrates the texture and edge information of industrial defects or the target to be detected onto the frequency component based on the energy concentration characteristics of the DCT basis function transformation. By using a non-learning fixed-weight DCT basis function convolution kernel, the number of training parameters and multiply-accumulate operations of the YOLOv11 target detection model are reduced.
[0028] Specifically, in the YOLOv11 object detection model, at least one KSFA module is set to operate on the low-level high-resolution feature map to enhance the detection capability of small objects and fine-grained textures; at least one KSFA module is set to operate on the high-level low-resolution feature map to enhance the global semantic representation capability of objects in complex backgrounds; the number of frequencies, the spatial resolution of the feature map, and the target size distribution are set according to the following rules: When the resolution of the input image is higher than the resolution threshold and the target size span is greater than the span threshold, the number of frequencies is set to a larger value to preserve the low-frequency global structure information and mid-to-high frequency texture details of industrial defects or the target to be detected. When the input image resolution is lower than the preset resolution value or the target shape conforms to the simple shape standard, the frequency quantity is set to a smaller value to reduce the computational load of the KSFA module and suppress high-frequency noise in industrial defects or the target data to be detected.
[0029] In one specific implementation, the frequency attention convolutional layer is implemented using a 1×1 convolution or a depthwise separable convolutional structure. The frequency attention coefficients output by the frequency attention convolutional layer are normalized by the Sigmoid or Softmax function and then multiplied with the corresponding frequency domain features channel by channel to achieve adaptive reweighting of features in different frequency bands.
[0030] In this embodiment, the improvements to the YOLOv11 object detection model also include: Some standard convolutions in the backbone feature extraction network or the neck network of feature fusion are replaced with depthwise separable convolutions or Ghost convolutions to reduce redundant computation between feature map channels of tensors; the number of channels of features at each scale in the feature pyramid network of the YOLOv11 object detection model is compressed, and the spatiotemporal frequency domain feature enhancement capability of the KSFA module is combined to reduce the number of parameters and FLOPs of the YOLOv11 object detection model while maintaining detection accuracy.
[0031] Specifically, the KSFA module takes a 5-dimensional tensor as input. It contains the following two core branches: Time Branch: Addressing object movement or camera shakiness in industrial inspections, spatial information is compressed using AdaptiveAvgPool3d and AdaptiveMaxPool3d; learnable parameters alpha and beta are introduced to dynamically fuse average and max-pooling features; and a fully connected layer `fc_t` is used to capture time steps. T The correlation between them is used to generate temporal attention weights, suppress temporal noise such as lighting flicker, and lock key frame features; Spatial Frequency Branch: Unlike ordinary convolution learning pixel features, this branch utilizes the Discrete Cosine Transform (DCT) principle, predefining DCT filters (such as 3×3, 7×7, 8×8). These filters have fixed (or partially fixed) weights, requiring no large gradient updates and significantly reducing computational overhead. The `select_method` selects high-frequency or low-frequency components containing object contour and texture information. The feature map after the DCT transformation is processed using FreConv (frequency convolution) to generate a spatial attention mask. Frequency domain features are naturally sensitive to the structured information of images (such as cracks and scratches) and insensitive to color changes, thus greatly improving the model's generalization ability with small sample sizes. Through learnable parameters... t, s and x The temporal enhancement features and the spatial frequency domain enhancement features are weighted and fused.
[0032] In another specific embodiment, the construction process of the KSFA module is as follows: Initialization parameters: Define the number of frequencies (freq_num, e.g., 49 corresponds to 7x7 DCT), the number of channels, the number of time steps, etc. DCT filter generation: A DCT7x7 or DCT3x3 class is instantiated based on freq_num, which generates a standard DCT basis function matrix. In the code, self.dct_filter.get_filter(filter_id) is used to retrieve a specific frequency filter; Forward propagation process: Input processing: Input x Shape Simulated T=2, C=32; Temporal attention computation: avg_map=self.avg_pool_c(x)max_map=self.max_pool_c(x)map_add=self.alphaavg_map+self.betamax_mapmap_fusion_t=self.fc_t(map_add).transpose(1,2)t_mean_sig=self.sigmoid(torch.mean(map_fusion_t, dim=2)) x_t = xt_mean_sig + x # Residual connection; This step extracts key features in the time dimension, enabling the model to focus on the clearest or most informative frames; Frequency domain spatial attention computation: # Get DCT weights; no gradient update required, extremely fast computation: dct_weight = self.dct_filter.get_filter(...) #Convolution operation extracts frequency domain features: dct_feature=F.conv2d(torch.mean(x_t,dim=1),dct_weight,stride=1,padding=self.p) # Generate attention map dct_feature=self.freq_attention(dct_feature) x_s = x_tself.sigmoid(dct_feature) + x_t; Here, the frequency map extracted by DCT often contains the edges (high frequency) or main structure (low frequency) of the image, and is extremely sensitive to industrial defects (usually manifested as high frequency anomalies); Final output: x = (x_t self.t + x_s self.s) / 2; the output maintains the original input size and can directly replace the original convolution module.
[0033] Furthermore, after embedding the aforementioned KSFA module into the YOLOv11 C3k2 or C2f module, testing was conducted on an electronic component appearance inspection production line. Hardware environment: Embedded NPU development board with a computing power of 5 TOPS; Dataset: Only 100 defect samples, such as scratches and edge chips, are used for training.
[0034] Furthermore, comparing the results: Original YOLOv11n: FPS approximately 120, mAP@50 65% (overfitting due to insufficient data); Model of this invention: FPS increased to 150, thanks to DCT replacing some ordinary convolutions, mAP@50 reached 88%; Conclusion: With reduced data volume, accuracy was significantly improved, and the inference speed met the requirements of ultra-high-speed production lines.
[0035] To aid in a better understanding of the present invention, a more comprehensive and specific embodiment is described, in which the present invention provides an industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, comprising the following steps: S1: Acquire inspection video streams or continuous frame image data from the industrial site; S2: Construct a YOLOv11 target detection model based on KSFA improvement; S3: After converting the inspection video stream or the continuous frame image data into tensor form, input it into the improved YOLOv11 target detection model. The KSFA module in the YOLOv11 target detection model performs spatiotemporal reconstruction and frequency domain filtering on the input tensor and outputs the enhanced features of the tensor. S4: Perform multi-scale prediction based on the enhanced features, and output the category and location information of industrial defects or targets to be detected.
[0036] In this embodiment, in step S2, the KSFA-based improvement includes inserting at least one KSFA module into the backbone feature extraction network or feature fusion neck network of the YOLOv11 feature extraction network.
[0037] Specifically, in step S3, the KSFA module performs spatiotemporal reconstruction and frequency domain filtering on the input tensor as follows: A1: The KSFA module receives a shape of... The input tensor, where, T For time step or frame number, B For batch size, C For the number of channels, H and W For spatial dimensions; A2: The input tensor is divided into a temporal correlation branch and a spatial frequency domain branch for parallel processing; A3: The outputs of the temporal correlation branch and the spatial frequency domain branch are weighted and fused using the learning parameters to obtain the final output; In step A2, the processing of the time-series dependent branches includes the following steps: The input tensors are rearranged and then subjected to global average pooling and global max pooling, respectively. The results of two pooling methods are fused using learned parameters. By using fully connected layers to perform feature interaction in the time dimension, a temporal attention map is generated for the time dimension. After normalization using the Sigmoid activation function, the features of the input tensor at each time step are temporally weighted. In step A2, the processing of the spatial frequency domain branch includes the following steps: Initialize the discrete cosine transform filter bank based on a preset number of frequencies; Specific DCT basis functions are selected as convolution kernel weights according to the selection strategy. The frequency selection strategy can be one of full-frequency selection, single-frequency selection or Top-K frequency selection. The feature map of the time-weighted input tensor is averaged in the time dimension, and the frequency domain features are extracted by performing a convolution operation using the convolution kernel of the DCT basis function. Spatial frequency attention maps for different frequency channels are generated through frequency attention convolutional layers, and the frequency domain features are spatially weighted.
[0038] Specifically, the KSFA module, based on the energy concentration characteristics of the DCT basis function transform, concentrates the texture and edge information of industrial defects or targets to be detected onto frequency components. By employing non-learned, fixed-weight DCT basis function convolution kernels, it reduces the number of training parameters and multiply-accumulate operations in the YOLOv11 target detection model. In the YOLOv11 target detection model, at least one KSFA module is set up to operate on low-level, high-resolution feature maps to enhance the detection capability of small targets and fine-grained textures; at least one KSFA module is set up to operate on high-level, low-resolution feature maps to enhance the global semantic representation capability of targets in complex backgrounds. The number of frequencies, the spatial resolution of the feature maps, and the target size distribution are set according to the following rules: When the resolution of the input image is higher than the resolution threshold and the target size span is greater than the span threshold, the number of frequencies is set to a larger value to preserve the low-frequency global structure information and mid-to-high frequency texture details of industrial defects or the target to be detected. When the input image resolution is lower than the preset resolution value or the target shape conforms to the simple shape standard, the number of frequencies is taken to reduce the computational load of the KSFA module and suppress high-frequency noise in industrial defects or the target data to be detected; the frequency attention convolutional layer is implemented using a 1×1 convolution or depthwise separable convolution structure. The frequency attention coefficients output by the frequency attention convolutional layer are normalized by the Sigmoid or Softmax function and then multiplied with the corresponding frequency domain features channel by channel to achieve adaptive reweighting of features in different frequency bands; The improvements to the YOLOv11 object detection model also include: Replace some standard convolutions in the backbone feature extraction network or the neck network of feature fusion with depthwise separable convolutions or Ghost convolutions to reduce redundant computation between feature map channels of tensors. The number of channels for features at each scale in the feature pyramid network of the YOLOv11 target detection model is compressed, and the spatiotemporal frequency domain feature enhancement capability of the KSFA module is combined to reduce the number of parameters and FLOPs of the YOLOv11 target detection model while maintaining detection accuracy.
[0039] In summary, the embodiments disclosed herein have at least the following technical effects: By adopting a fixed-weight DCT basis function convolution kernel, the KSFA module introduces dual attention in the spatiotemporal and frequency domains without increasing the number of trainable parameters. Combined with Ghost convolution, channel compression and other methods, the improved YOLOv11 model has 25% to 35% fewer parameters and FLOPs than the original YOLOv11, meeting the real-time deployment requirements of industrial edge devices. The frequency domain branch fully utilizes the energy concentration characteristics of DCT to map the texture edge information of subtle defects such as cracks, pores, and scratches to a few low-to-mid-frequency channels. Then, through frequency attention adaptive weighting, the model's mAP is improved by 3% to 7% in complex backgrounds. The temporal correlation branch can automatically suppress jittery frames and blurry frames, highlighting key clear frame features. In jittery inspection scenarios by drones or robots, the false negative rate is reduced by more than 40% compared to single-frame detection methods. By linking the frequency quantity K with the feature map resolution and target size distribution, an automatic adjustment is achieved to preserve rich texture in high-resolution shallow layers and suppress noise in low-resolution deep layers, further improving the robustness of multi-scale defect detection. The KSFA module has a simple structure and can be inserted after any C2f / C3k module in YOLOv11 without modifying the loss function or detector head. It can be directly transferred to YOLOv8 / YOLOv10 / YOLOv12 and other series of models.
[0040] It is understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. An industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention, characterized in that, Includes the following steps: S1: Acquire inspection video streams or continuous frame image data from the industrial site; S2: Construct a YOLOv11 target detection model based on KSFA improvement; S3: After converting the inspection video stream or the continuous frame image data into tensor form, input it into the improved YOLOv11 target detection model. The KSFA module in the YOLOv11 target detection model performs spatiotemporal reconstruction and frequency domain filtering on the input tensor and outputs the enhanced features of the tensor. S4: Perform multi-scale prediction based on the enhanced features, and output the category and location information of industrial defects or targets to be detected.
2. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 1, characterized in that, In step S2, the KSFA-based improvement includes inserting at least one KSFA module into the backbone feature extraction network or the neck network of the YOLOv11 feature extraction network.
3. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 2, characterized in that, In step S3, the KSFA module performs the spatiotemporal reconstruction and frequency domain filtering on the input tensor as follows: A1: the KSFA module receives an input tensor shaped wherein, T is a time step or frame number, B is a batch size, C is a number of channels, H and W is a spatial dimension; A2: The input tensor is divided into a temporal correlation branch and a spatial frequency domain branch for parallel processing; A3: The outputs of the temporal correlation branch and the spatial frequency domain branch are weighted and fused using the learning parameters to obtain the final output.
4. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 3, characterized in that, In step A2, the processing of the time-series correlation branch includes the following steps: The input tensor is rearranged and then subjected to global average pooling and global max pooling, respectively. The results of two pooling methods are fused using learned parameters. By performing feature interaction in the time dimension through a fully connected layer, a temporal attention map for the time dimension is generated; After normalization using the Sigmoid activation function, the features of the input tensor at each time step are temporally weighted.
5. The industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention as described in claim 3, characterized in that, In step A2, the processing of the spatial frequency domain branch includes the following steps: Initialize the discrete cosine transform filter bank based on the preset number of frequencies; Specific DCT basis functions are selected as convolution kernel weights according to the selection strategy, wherein the frequency selection strategy adopts one of full-frequency selection, single-frequency selection or Top-K frequency selection; The feature map of the input tensor after time-weighting is averaged in the time dimension, and the convolution operation is performed using the convolution kernel of the DCT basis function to extract frequency domain features. Spatial frequency attention maps for different frequency channels are generated by frequency attention convolutional layers, and the frequency domain features are spatially weighted.
6. The industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention as described in claim 5, characterized in that, The KSFA module concentrates the texture and edge information of the industrial defect or the target to be detected onto the frequency component based on the energy concentration characteristics of the DCT basis function transformation. By using the DCT basis function convolution kernel with non-learning fixed weights, the number of training parameters and multiply-accumulate operations of the YOLOv11 target detection model are reduced.
7. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 6, characterized in that, In the YOLOv11 target detection model, at least one KSFA module is set to act on low-level high-resolution feature maps to enhance the detection capability of small targets and fine-grained textures; at least one KSFA module is set to act on high-level low-resolution feature maps to enhance the global semantic representation capability of targets in complex backgrounds.
8. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 7, characterized in that, The number of frequencies, the spatial resolution of the feature map, and the target size distribution are set according to the following rules: When the resolution of the input image is higher than the resolution threshold and the target size span is greater than the span threshold, the number of frequencies is set to a larger value to preserve the low-frequency global structure information and mid-to-high frequency texture details of the industrial defect or the target to be detected. When the resolution of the input image is lower than the preset resolution value or the target shape conforms to the simple shape standard, the number of frequencies is taken to reduce the computational load of the KSFA module and suppress the high-frequency noise of the industrial defects or the target data to be detected.
9. The industrial inspection method based on improved YOLOv11 and spatiotemporal-frequency domain attention according to claim 5, characterized in that, The frequency attention convolutional layer is implemented using a 1×1 convolution or a depthwise separable convolutional structure. The frequency attention coefficients output by the frequency attention convolutional layer are normalized by the Sigmoid or Softmax function and then multiplied with the corresponding frequency domain features channel by channel to achieve adaptive reweighting of features in different frequency bands.
10. The industrial inspection method based on improved YOLOv11 and spatiotemporal frequency domain attention according to any one of claims 2 to 9, characterized in that, The improvements to the YOLOv11 object detection model also include: Replace some standard convolutions in the backbone feature extraction network or the feature fusion neck network with depthwise separable convolutions or Ghost convolutions to reduce redundant computation between feature map channels of the tensor; The number of channels for features at each scale in the feature pyramid network of the YOLOv11 target detection model is compressed, and combined with the spatiotemporal frequency domain feature enhancement capability of the KSFA module, the number of parameters and FLOPs of the YOLOv11 target detection model are reduced while maintaining detection accuracy.