# A Deep Learning-Based Algorithm for Ceramic Product Defect Detection
## 2 Materials and Methods
### Lightweight YOLOv10s Model
#### 2.2.2 Improved PSA Module  
To enhance the model's global modeling performance, YOLOv10 innovatively introduces the PSA module. This module integrates a Multi-Head Self-Attention (MHSA) module with a Feed-Forward Network (FFN) module, enabling YOLOv10 to exhibit outstanding detection capabilities in complex object detection tasks. However, in the specific application scenario of ceramic product defect detection, the MHSA module poses challenges in terms of high computational complexity and a large number of parameters, which impact real-time processing performance. Therefore, this study adopts an efficient ECA mechanism that can adaptively adjust feature weights across channels, focusing on enhancing the expressiveness of key features while avoiding unnecessary complexity and overfitting. Additionally, to further improve the model's ability to capture multi-scale features and enhance the richness of feature representation, this study replaces the global average pooling layer in the ECA mechanism with three parallel depthwise separable convolutions. This modification enables the model to exhibit higher accuracy and robustness in tasks requiring fine-grained feature representation, such as ceramic product defect detection.  
The network architecture of the improved PSA module is illustrated in Figure 5. Its core innovation lies in the integration of a multi-scale enhanced ECA module. Specifically, in the design of the multi-scale enhanced ECA module, the input feature map is first fed in parallel into three depthwise separable convolutional layers with kernel sizes of 1 \(\times\) 1, 3 \(\times\) 3, and 5 \(\times\) 5, respectively. These layers are capable of capturing spatial information at different scales. Subsequently, the weighted-fused channel features are passed into a one-dimensional convolutional layer, which aggregates information from adjacent channels through local cross-channel interactions, thereby adaptively capturing inter-channel dependencies. The output of the one-dimensional convolutional layer is then normalized using a Sigmoid activation function to obtain attention weights. Finally, these weights are used to reweight each channel of the input feature map, enhancing the feature representation of important channels while suppressing the influence of unimportant ones, thereby improving the network's ability to capture key features.  
By introducing multi-scale depthwise separable convolutional layers, the multi-scale enhanced ECA module can more effectively capture spatial information at different scales, focusing on fine-grained local features, medium-scale regional features, and broader contextual information, respectively. This enhances the model's adaptability to complex scenarios. Meanwhile, the one-dimensional convolutional layer preserves the adaptive capability of inter-channel dependencies, dynamically aggregating information from adjacent channels through local cross-channel interactions. This enables the model to automatically adjust the weight distribution between channels based on the input features, not only improving the expressiveness of key features but also effectively suppressing irrelevant or redundant information, further enhancing the model's discriminative ability.