A low-complexity spatially gated depthwise residual network for automated visual inspection of castings
摘要
Ensuring defect-free castings is essential for maintaining product reliability and reducing manufacturing losses. Manual inspection is labor-intensive, error-prone, and difficult to scale in modern production lines, motivating the adoption of automated, intelligent inspection systems. This paper presents a lightweight HorNet-inspired Convolutional Neural Network (CNN) for real-time casting defect detection, featuring a Spatially Gated Depthwise Residual (SGDR) block that integrates recursive gated attention with depthwise separable convolutions. This design enhances spatial selectivity and defect localization capability while maintaining extremely low parameter counts and computational costs. The proposed approach is evaluated on a publicly available industrial casting dataset containing both defective and non-defective grayscale images, the same dataset used for all comparative methods to ensure a fair and direct evaluation. Experimental results demonstrate an accuracy of 99.23%, precision of 99.24%, recall of 99.23%, and an F1-score of 99.23%, achieving competitive or superior performance compared to state-of-the-art methods while using only 57,628 parameters (0.22 MB) and 0.704 GFLOPs for a 224