TinyCaracalFormer: a lightweight frequency-domain hybrid model for steel surface defect inspection
Abstract
Manual inspection in steel production suffers from low efficiency and unstable accuracy, while standard Transformer models are limited by quadratic self-attention complexity and mandatory positional encoding. This work constructs a unified two-stage steel defect detection framework with dual convolutional neural network (CNN) backbones for adaptive feature extraction. On this basis, it introduces fast Fourier transform (FFT)-based multi-head Fourier (MHF) frequency modeling and further proposes the lightweight hybrid TinyCaracalFormer, which integrates frequency-domain global modeling and sliding window attention (SWA) for local feature capture. Dual-CNN feature flow and module operations are specified with tensor dimensions. All models are evaluated on the offline-augmented Northeast University (NEU) steel defect dataset under identical training settings, with comparisons on parameters, approximate FLOPs, parameter memory and CPU latency. Experimental results show that the vanilla Transformer delivers the best detection accuracy, while Caracal and TinyCaracalFormer provide favorable accuracy-efficiency trade-offs for resource-limited industrial inspection.