An efficient triple-domain YOLOv8 for real-time aluminum profile defect detection Authors: Mohammad Rostami, Afsaneh Fatemi Published: 2026 ABSTRACT Surface defect detection in aluminum profiles remains challenging due to complex textures, illumination variations, reflective noise, and subtle small-scale defects. Conventional YOLO-based detectors rely primarily on spatial-domain features and fail to exploit complementary frequency and gradient information, which is essential for detecting weak, texture-oriented, and elongated defects. This paper proposes Adaptive Triple-Domain YOLOv8, a real-time framework that integrates spatial, frequency (Discrete Wavelet Transform), and gradient (Gabor filter) features within a unified architecture. An adaptive attention-based fusion module dynamically integrates multi-domain features, enabling defect-specific discrimination while preserving high inference speed. Experiments on the Tianchi benchmark demonstrate that the proposed method consistently outperforms spatial-domain, dual-domain, and recent detectors, achieving a mAP@0.5 of 96.7% and a mAP@0.5:0.95 of 73.2% at over 100 FPS. The method significantly improves the detection on low-contrast, texture-dominated, and elongated defects, providing a favorable balance between detection accuracy and real-time efficiency for industrial aluminum surface inspection.Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1038/s41598-026-58308-1. Introduction Surface defect detection is a cornerstone of industrial quality assurance, particularly in aluminum profile manufacturing, where small defects can compromise structural integrity, aesthetic quality, and end-user safety. Recent studies highlight that defects such as scratches, rolling marks, pits, cracks, oxidation, and oil stains remain among the most challenging categories to detect reliably under real production conditions1–7. Traditional manual inspection, reliant on human operators, suffers from subjectivity, visual fatigue, and limited throughput, rendering it inadequate for today’s high-speed, precision-driven production lines. The advent of deep learning has revolutionized this field by enabling fully automated, data-driven visual inspection systems8,9. Among deep learning-based frameworks, the YOLO1 family has become the standard for real-time industrial applications due to its unified one-stage architecture and favorable speed-accuracy trade-off. From YOLOv310 to the current YOLOv811, continuous improvements in backbones, PAN-FPN necks, and detection heads have significantly enhanced multi-scale detection capabilities12–14. Recent adaptations for aluminum defect detection further demonstrate YOLOv8’s effectiveness in industrial scenarios, incorporating attention mechanisms, lightweight feature extractors, and enhanced context modeling to improve defect sensitivity4,15–24. Spatial-domain enhancements to YOLO-based detectors have also demonstrated improved performance. For example, YOLO-PDC25 integrates deformable convolutions into YOLOv7 to better model geometric variations in surface defects, while EMSPENet26, provides an efficient multi-scale perceptual enhancement network for aluminum defect detection. Similarly, TRIDENet21 introduces selective channel activation and a task-gated detection head to suppress noise and decouple regression and classification for lightweight defect detection, while primarily relying on multi-scale spatial feature fusion. Nevertheless, these methods operate solely in the spatial domain. Additional studies have introduced attention-enhanced CNN detectors, lightweight architectures, and transformer-inspired modules for industrial surface anomaly detection27–38, further demonstrating the rapid expansion of this research direction. To overcome the limitations of purely spatial-domain features, researchers have increasingly explored complementary feature representations. Frequency-domain analysis based on wavelet transforms has proven particularly effective, as defects frequently appear as localized spectral irregularities. Studies combining DWT with YOLO variants have reported improved performance in steel39–41 and glass42 inspections. Similarly, DFRD-Net43 combines spatial convolution with learnable frequency-domain high-pass filtering in a dual-domain framework, but remains limited to spatial-frequency fusion. Concurrently, SDT-Net44 incorporates Sobel-based edge extraction within a YOLO-based detector to capture gradient information for steel defect detection, but relies on hierarchical edge pyramids rather than explicit frequency-domain analysis or adaptive multi-domain fusion. However, the application of these methods in aluminum profile inspection remains limited, and existing fusion strategies are typically fixed and unable to adapt to diverse defect patterns or integrate both frequency and gradient cues simultaneously. In addition, gradient-domain features are highly sensitive to edge, line, and directional texture patterns, which are essential for detecting highly oriented defects such as scratches and rolling marks. Methods leveraging gradient-enhanced convolutional branches or Gabor filter-based feature extraction demonstrate significant improvements in preserving directional structures3,28,45,46. Yet, existing methods fail to fully exploit the complementary nature of spatial, frequency, and gradient cues within a unified detection architecture. This limitation leads to suboptimal performance in detecting low-contrast textures, repetitive patterns, and anisotropic defects, which are common challenges in aluminum profile inspection. Existing wavelet-based approaches, such as SFC-YOLOv839 and Wavelet-FDA40, incorporate frequency-domain information into YOLO architectures but remain fundamentally dual-domain designs that rely on static concatenation or wavelet-attention mechanisms. These methods improve texture sensitivity but do not explicitly integrate directional gradient cues, limiting their ability to represent edge-oriented defect patterns. In contrast, the proposed model introduces a unified triple-domain framework that jointly exploits spatial, wavelet-frequency, and gradient (Gabor-based) cues through an adaptive attention-weighted fusion mechanism. The gradient domain is specifically designed to capture directional edge and orientation-aware features that are not explicitly modeled in prior dual-domain detectors, enabling a more comprehensive representation of surface defects across structural, textural, and edge characteristics. To address these issues, the Efficient Triple-Domain YOLOv8 is introduced, integrating spatial, wavelet frequency, and Gabor gradient features through three parallel streams and an adaptive attention-based fusion module. This unified design enhances robustness across diverse defect types by leveraging the complementary strengths of the three domains. In this paper, the term “efficient” refers to a compact yet highly efficiency design that reduces model parameters, FLOPs, and training/inference time while maintaining higher detection accuracy than standard YOLOv8n and competitive performance with YOLOv8s, despite a moderate increase in parameters. Experimental results on the Tianchi benchmark show that the proposed model achieves notable improvements in detection precision and real-time efficiency, thereby advancing industrial surface defect inspection. In this study, the task is formulated as an object detection problem in which the model predicts the spatial positions of defects using bounding boxes. The performance of the proposed method is evaluated using standard object detection metrics, including precision, recall, F1-score, and mean average precision (mAP). The main contributions of this study are summarized as follows: A unified triple-domain framework that integrates spatial, wavelet-frequency, and Gabor-gradient features into an efficient YOLOv8 architecture through adaptive fusion.An adaptive attention-based fusion module that dynamically weights the three feature domains to enhance the detection of specific defect types (e.g., gradient cues for scratches and frequency cues for textures defects).The proposed model achieves an mAP@0.5 of 96.7% and over 100 FPS on the Tianchi benchmark, demonstrating suitability for high-speed industrial inspection. A unified triple-domain framework that integrates spatial, wavelet-frequency, and Gabor-gradient features into an efficient YOLOv8 architecture through adaptive fusion. A unified triple-domain framework that integrates spatial, wavelet-frequency, and Gabor-gradient features into an efficient YOLOv8 architecture through adaptive fusion. An adaptive attention-based fusion module that dynamically weights the three feature domains to enhance the detection of specific defect types (e.g., gradient cues for scratches and frequency cues for textures defects). An adaptive attention-based fusion module that dynamically weights the three feature domains to enhance the detection of specific defect types (e.g., gradient cues for scratches and frequency cues for textures defects). The proposed model achieves an mAP@0.5 of 96.7% and over 100 FPS on the Tianchi benchmark, demonstrating suitability for high-speed industrial inspection. The proposed model achieves an mAP@0.5 of 96.7% and over 100 FPS on the Tianchi benchmark, demonstrating suitability for high-speed industrial inspection. The rest of this paper is organized as follows. Section 2 describes the image preprocessing and dataset normalization procedures. Section 3 introduces the proposed Efficient Triple-Domain YOLOv8 architecture, including the frequency and gradient streams and the adaptive fusion mechanism. Section 4 presents the experimental setup, evaluation metrics, and comparative analyses with recent methods. Finally, Sect. 5 concludes the paper and discusses future research directions. Image preprocessing To ensure compatibility with the model architecture, the input images undergo standardized preprocessing. Each image is first converted to RGB format (if needed) and resized to 640 × 640 pixels while preserving the original aspect ratio. The longest side of the image is scaled to 640 pixels, and symmetric padding with a constant value of 114 is applied to the shorter side using the letterbox strategy commonly employed in YOLO-based detectors10,47. This padding value is consistent with the preprocessing used during YOLOv8 pre-training on the COCO dataset, preventing geometric distortion and ensuring uniform input dimensions. The scaling ratio is computed as shown in Eq. (1).1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{r}} = \frac{{640}}{{\max \left( {{\mathrm{w}},{{~h}}} \right)}}$$\end{document} where w and h denote the original width and height of the image, respectively. The new dimensions are then obtained as shown in Eq. (2). The remaining areas are filled with uniform padding of 114. Pixel values are subsequently normalized to the range [0, 1] by dividing by 255, as shown in Eq. (3).2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$({\mathrm{w}}_{{{\mathrm{new}}}} ,{\mathrm{h}}_{{{\mathrm{new}}}} ) = ({\mathrm{r}} \times {\mathrm{w}},{\mathrm{r}} \times {\mathrm{h}})$$\end{document} 3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Inorm}}~~~~\left( {{\mathrm{x}},{\mathrm{y}},{\mathrm{c}}} \right) = \frac{{{\mathrm{I}}\left( {{\mathrm{x}},{\mathrm{y}},{\mathrm{c}}} \right)}}{{255}}$$\end{document} The color channels are then standardized using the ImageNet mean and standard deviation for the red, green, and blue channels, respectively (i.e., µ = [0.485, 0.456, 0.406], σ = [0.229, 0.224, 0.225])1,48. The transformation is performed using Eq. (4).4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$~\left( {{\mathrm{x}},{\mathrm{y}},{\mathrm{c}}} \right) = \frac{{{\mathrm{I}}\left( {{\mathrm{x}},{\mathrm{y}},{\mathrm{c}}} \right)}}{{255}}$$\end{document} Although the target domain (aluminum profile surfaces) differs from natural images in ImageNet, these statistics are retained because the YOLOv8 backbone was pre-trained on ImageNet. Using the same normalization ensures stable gradient flow and preserves learned features during learning. For the frequency (wavelet) and gradient streams, the RGB image is converted to grayscale to reduce computational complexity and focus on structural and textural features49. The grayscale conversion is performed using the standard coefficients shown in Eq. (5).5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$~~{\mathrm{I}}_{{{\mathrm{gray}}}} ({\mathrm{x}},{\mathrm{y}}) = 0.{\mathrm{299}} \cdot {\mathrm{R}}({\mathrm{x}},{\mathrm{y}}) + 0.{\mathrm{587}} \cdot {\mathrm{G}}({\mathrm{x}},{\mathrm{y}}) + 0.{\mathrm{114}} \cdot {\mathrm{B}}({\mathrm{x}},{\mathrm{y}})$$\end{document} The grayscale image is normalized similarly to the color image for consistency across streams. Finally, both processed images are converted to tensors with appropriate dimensions. This unified preprocessing guarantees that the spatial-domain, frequency-domain, and gradient-domain streams operate on standardized inputs with aligned resolutions and distributions, which is essential for stable multi-domain fusion. Table 1 summarizes the preprocessing parameter settings. Table 1Preprocessing parameter settings.ParameterValueExplanationTARGET_SIZE640Output image dimensions (width × height)PAD_VALUE114Constant padding valueMEAN_RGB[0.485, 0.456, 0.406]ImageNet mean for R, G, B channelsSTD_RGB[0.229, 0.224, 0.225]ImageNet standard deviation for R, G, B channelsGRAYSCALE_COEFFS[0.299, 0.587, 0.114]Luminance-preserving coefficients for RGB to grayscale conversionNORMALIZATION_RANGE[0, 1]Target range after pixel value normalizationGABOR_SCALES{4, 8}Multi-scale wavelengths for gradient extractionGABOR_ORIENTATIONS{0°, 45°, 90°, 135°}Directional sensitivity for defect edgesGRADIENT_CHANNELS8Number of Gabor response maps Table 1Preprocessing parameter settings.ParameterValueExplanationTARGET_SIZE640Output image dimensions (width × height)PAD_VALUE114Constant padding valueMEAN_RGB[0.485, 0.456, 0.406]ImageNet mean for R, G, B channelsSTD_RGB[0.229, 0.224, 0.225]ImageNet standard deviation for R, G, B channelsGRAYSCALE_COEFFS[0.299, 0.587, 0.114]Luminance-preserving coefficients for RGB to grayscale conversionNORMALIZATION_RANGE[0, 1]Target range after pixel value normalizationGABOR_SCALES{4, 8}Multi-scale wavelengths for gradient extractionGABOR_ORIENTATIONS{0°, 45°, 90°, 135°}Directional sensitivity for defect edgesGRADIENT_CHANNELS8Number of Gabor response maps Preprocessing parameter settings. Algorithm 1 shows the image preprocessing procedure. Algorithm 1Image preprocessing. Image preprocessing. Proposed triple-domain adaptive YOLOv8 architecture The proposed model adopts a triple-domain architecture for real-time detection of defects in aluminum profiles. After image preprocessing, three parallel processing streams operate simultaneously: (i) a spatial-domain stream based on the YOLOv8 backbone for extracting structural and contextual feature, (ii) a frequency-domain stream leveraging the discrete wavelet transform (DWT) to capture multi-resolution texture information, and (iii) a gradient-domain stream designed to extract directional edge and orientation-aware features using multi-scale Gabor filters. These complementary feature sets are integrated via an adaptive attention-based fusion mechanism, which dynamically learns the optimal weighting for each domain based on image content and defect features. Unlike prior dual-domain detectors that combine spatial and frequency cues, the proposed architecture introduces an additional gradient-domain stream based on Gabor filtering to capture directional edge information. This stream complements both spatial-domain and wavelet-frequency-domain representations, while the adaptive attention-based fusion module dynamically balances the contributions of the three domains to produce a more discriminative representation for surface defects. The fused multi-domain features are fed into the standard YOLOv8 neck and detection head to predict defect bounding boxes, class labels, and confidence scores. Figure 1 provides a schematic overview of the proposed triple-domain adaptive YOLOv8 architecture. Fig. 1Schematic overview of the proposed triple-domain fusion concept. Schematic overview of the proposed triple-domain fusion concept. For clarity and reproducibility, the architectural parameters, feature dimensions, and scale transformations for each domain are described in the following subsections. Compared with spatial-domain and dual-domain approaches, this design explicitly leverages complementary information across the spatial, frequency, and gradient domains, enabling more robust detection of low-contrast, texture-dominated, and elongated defects while preserving real-time inference efficiency. Although the proposed architecture introduces three parallel processing streams, the additional components are intentionally designed to remain computationally efficient. Specifically, the wavelet and gradient branches employ shallow CNN structures with limited channel widths (32 → 64 → C/4), thereby introducing only a modest increase in model complexity. Moreover, both branches follow the same multi-scale hierarchy as the YOLOv8 backbone and primarily rely on simple resizing operations instead of deep convolutional stacks. The adaptive fusion mechanism is also implemented using a compact two-layer MLP with a hidden dimension of 128, adding only a minimal number of parameters to the overall network. Consequently, the proposed design enriches feature representation across spatial, frequency, and gradient domains while maintaining efficient computation. As demonstrated in the experimental evaluation, the resulting model maintains real-time inference capability while improving the robustness of defect detection. Spatial-domain feature extraction with the YOLOv8 backbone In the first processing stream of the proposed model, the standard YOLOv8 backbone is employed to extract spatial and structural features from the preprocessed input image (640 × 640 × 3). To preserve computational efficiency, the spatial-domain stream follows the original efficient design of the YOLOv8 backbone without introducing additional heavy blocks or channel expansions. The backbone begins with a stem consisting of two convolutional layers with a stride of 2, each followed by batch normalization and SiLU activation. This rapidly reduces the spatial dimensions while extracting preliminary features. The backbone consists of four progressive stages, each comprising multiple C2f (Cross-Stage Partial with Feed-Forward) blocks and down-sampling convolutional layers. The core convolutional operation in these layers follows the sequence: convolution, batch normalization, and SiLU activation, formally expressed for layer l, as shown in Eq. (6).6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$~X^{{(l + 1)}} = SiLU\left( {BatchNorm\left( {W^{{(l)}} *X^{{(l)}} + b^{{(l)}} } \right)} \right)~~$$\end{document} where l denotes the layer index, X(l) is the input feature map of layer l, W(l) and b(l) are the learnable kernel weights and biases, respectively, * denotes the convolution operation, and SiLU denotes the Sigmoid Linear Unit activation function. The C2f block splits the feature channels, applies a series of bottleneck layers with residual connections to one branch, and then concatenates the resulting features with those from the other branch. This design improves gradient flow, reduces computational redundancy, and balances network depth with efficiency. At the final stage, the backbone incorporates an SPPF2 module, which applies three sequential 5 × 5 max-pooling operations on the same feature map, followed by channel-wise concatenation and a final 1 × 1 convolution. This efficient pooling strategy captures multi-scale contextual information and expands the effective receptive field with minimal computational cost. The overall feature extraction process can be summarized as shown in Eq. (7).7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{F}}_{{{\mathrm{spatial}}}} = {\mathrm{B}}_{{{\mathrm{YOLOv8}}}} ({\mathrm{I}}_{{{\mathrm{preprocessed}}}} )$$\end{document} where Ipreprocessed denotes the standardized input image, and BYOLOv8 represents the composite transformation of the YOLOv8 backbone (stem, C2f stages, and SPPF). The output of this stream consists of three hierarchically organized, multi-scale feature maps, P3, P4, and P5, generated at resolutions of 80 × 80, 40 × 40, and 20 × 20, respectively (for a 640 × 640 input). These maps capture different levels of abstraction: P3 retains high-resolution spatial details essential for fine-grained defects, such as micro-scratches; P4 captures mid-level structural features; and P5, enriched by the wide receptive field of the SPPF module, emphasizes global context and larger defect patterns. This hierarchical multi-scale extraction enables the model to comprehensively represent diverse spatial patterns in aluminum surface defects. Algorithm 2 summarizes the workflow of the YOLOv8 backbone. Algorithm 2Spatial feature extraction using the YOLOv8 Backbone. Spatial feature extraction using the YOLOv8 Backbone. The structure of the YOLOv8 Backbone is shown in Fig. 2. Fig. 2YOLOv8 backbone structure. YOLOv8 backbone structure. Frequency-domain feature extraction via wavelet-CNN In the second stream, a single-level two-dimensional discrete wavelet transform (2D-DWT) with the Haar basis is applied to the preprocessed grayscale image (640 × 640 × 1) to extract frequency-domain features. This stream is designed to remain computationally efficient, relying on a single-level wavelet decomposition and a shallow CNN with minimal channel width to avoid excessive computational overhead. A single-level 2D discrete wavelet transform (DWT) with the Haar basis is applied due to its low computational cost and suitability for real-time inference. Given a 640 × 640 input, it yields four 320 × 320 sub-bands: LL (low-frequency structural approximation), LH (horizontal details), HL (vertical details), and HH (diagonal details). The LL band captures low-frequency structure, while LH/HL/HH contain directional high-frequency details. This transformation is formally expressed as Eq. (8).8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\left(\genfrac{}{}{0pt}{}{\mathrm{L}\mathrm{L}\:\:\:\mathrm{L}\mathrm{H}}{\mathrm{H}\mathrm{L}\:\:\mathrm{H}\mathrm{H}}\right)={\mathrm{D}\mathrm{W}\mathrm{T}}_{\mathrm{H}\mathrm{a}\mathrm{a}\mathrm{r}}\left(\mathrm{I}\mathrm{g}\mathrm{r}\mathrm{a}\mathrm{y}\text{}\right)\:$$\end{document} where Igray is the input grayscale image. The LL sub-band captures overall structure and smooth luminance variations, while LH, HL, and HH are highly sensitive to horizontal, vertical, and diagonal edges, textures, and fine details. These characteristics are critical for detecting subtle, low-contrast, and directional defects such as parallel scratches, vertical cracks, and surface irregularities. Each sub-band is processed by a lightweight CNN composed of two 3 × 3 convolutional layers with 32 and 64 channels respectively, followed by ReLU activation. A final 1 × 1 convolution reduces the channel dimension to C/4 to facilitate subsequent concatenation. Here, lightweight indicates that the convolutional network is deliberately kept shallow, with minimal layers and channels, to ensure low parameter count and computational cost compared to traditional CNN architectures. The independent processing for each sub-band can be formulated as Eq. (9).9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{F}}_{{\mathrm{k}}} = {\mathrm{C}}_{{\theta {\mathrm{k}}}} ({\mathrm{B}}_{{\mathrm{k}}} ),{\mathrm{k}} \in \{ {\mathrm{LL}},{\mathrm{LH}},{\mathrm{HL}},{\mathrm{HH}}\}$$\end{document} where Bk denotes the k-th sub-band and Cθk represents the CNN with learnable parameters θk. The resulting features from all four sub-bands are then merged via channel-wise concatenation to form a frequency feature map. The concatenated feature map (Ffreq) is given by Eq. (10).10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{F}}_{{{\mathrm{freq}}}} = {\mathrm{Concat}}({\mathrm{F}}_{{{\mathrm{LL}}}} ,{\mathrm{F}}_{{{\mathrm{LH}}}} ,{\mathrm{F}}_{{{\mathrm{HL}}}} ,{\mathrm{F}}_{{{\mathrm{HH}}}} )$$\end{document} A single-level wavelet decomposition is adopted to preserve sufficient spatial resolution for detecting small surface defects. Deeper decompositions progressively reduce the spatial size of the sub-bands (e.g., 160 × 160 or 80 × 80), which may lead to the loss of fine defect structures while increasing computational cost. Therefore, the single-level configuration provides an effective trade-off between frequency representation and spatial detail preservation. After concatenation and channel alignment via a 1 × 1 convolution, the tensor (320 × 320×C) is resized using bilinear interpolation to generate three multi-scale features F3 (80 × 80×C), F4 (40 × 40×C), and F5 (20 × 20×C) aligned with YOLOv8 spatial levels P3, P4, P5. This multi-scale alignment ensures optimal correspondence between frequency-domain details at different resolutions and the corresponding spatial features. Bilinear interpolation is adopted for feature alignment due to its computational efficiency and its widespread use in modern detection architectures such as FPN-based detectors and YOLO frameworks. Although interpolation does not introduce additional high-frequency information, it preserves the spatial structure of the feature maps while enabling efficient multi-scale alignment. Moreover, in the proposed architecture, high-frequency details are explicitly captured by the wavelet and gradient streams before the resizing stage, which mitigates potential information degradation during interpolation. The output of this stream provides multi-resolution frequency features that significantly enhance the detection of texture-oriented and low-contrast defects. These features are then forwarded to the adaptive triple-domain fusion module. Algorithm 3 outlines the frequency domain processing. Algorithm 3Wavelet‑CNN Feature Extraction. Wavelet‑CNN Feature Extraction. Figure 3 illustrates the structure of the Wavelet-CNN model. Fig. 3Wavelet‑CNN model structure. Wavelet‑CNN model structure. Gradient-domain feature extraction In the proposed triple-domain framework, the gradient domain acts as the third parallel stream. To keep the overall model compact, the gradient domain employs a lightweight Gabor-CNN encoder, avoiding deep stacks and wide channels while still capturing rich orientation-sensitive features. The motivation for gradient-based features stems from the fact that many defects in aluminum profiles, such as narrow scratches, surface cracks, and rolling marks, exhibit directional structures and edge patterns. These characteristics are often weakly represented in RGB spatial features and may not be fully captured by frequency-domain features alone. Gradient features emphasize local intensity transitions and edge orientations while being inherently robust to illumination variations, making them effective for modeling fine-grained and oriented defects. The input to this stream is the normalized grayscale image (640 640 × 1) obtained from the preprocessing stage. Grayscale conversion reduces computational overhead and directs focus exclusively toward structural variations, excluding chromatic information. To capture multi-scale and multi-directional gradient information, a bank of Gabor filters is employed. Gabor filters provide optimal localization in the spatial and frequency domains and are widely recognized for their effectiveness in modeling oriented textures and directional edges prevalent in industrial surface defects. The two-dimensional Gabor filter is defined in Eq. (11).11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{G}}\left( {{\mathrm{x}},{\mathrm{y}}} \right) = {\mathrm{exp}}( - \frac{{{\mathrm{x}}^{{\prime \:2}} + \gamma \:^{2} {\mathrm{y}}^{{\prime \:2}} }}{{2\sigma \:^{2} }})\:{\mathrm{cos}}(2\pi \:\:\frac{{{\mathrm{x}}^{{\prime \:}} }}{{\lambda \:}} + \psi \:)~~~\,~$$\end{document} where the rotated coordinates are given by: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{x}}^{{\prime\:}}$$\end{document} = x cos(θ) + y sin(θ), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{y}}^{{\prime\:}}$$\end{document} = −x sin(θ) + y cos(θ). Here, λ denotes the wavelength (scale), θ specifies the orientation, ψ is the phase offset, σ determines the Gaussian envelope width, and γ governs the spatial aspect ratio. In this model, four orientations (θ ∈ {0°, 45°, 90°, 135°}) and two wavelength scales (λ₁ = 4, λ₂ = 8) are used, generating a total of eight Gabor filters that respond to defects with diverse orientations and sizes. In this implementation, the Gabor filter bank uses the following parameter configuration: wavelength λ ∈ {4, 8}, orientation θ ∈ {0°, 45°, 90°, 135°}, Gaussian envelope σ = 2.0, phase offset ψ = 0, and aspect ratio γ = 0.5. This configuration produces eight directional filters that capture defect structures at multiple orientations and scales. In this work, the Gabor filter parameters are intentionally kept fixed to maintain the efficient nature of the framework and provide stable low-level directional priors for edge and orientation representation. These fixed filters act as efficient handcrafted operators that capture fundamental gradient structures without introducing additional learnable parameters. The gradient branch is designed to complement rather than replace the learnable spatial and frequency streams. Moreover, using fixed filters avoids the extra computational cost of learnable orientation-aware filters, thereby preserving the efficiency required for real-time industrial defect detection. Each Gabor filter produces a directional response map highlighting intensity transitions aligned with its orientation and scale. These maps are concatenated along the channel dimension to form multi-channel gradient features. The concatenated maps are formed as Eq. (12).12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{G}} = {\mathrm{Concat}}({\mathrm{G}}_{{\theta {\mathrm{1}}}} ,{\mathrm{G}}_{{\theta {\mathrm{2}}}} , \ldots ,{\mathrm{G}}_{{\theta {\mathrm{N}}}} )$$\end{document} where Gθi denotes the response of the i-th Gabor filter. Channel-wise concatenation preserves explicitly directional information, enabling subsequent layers to selectively exploit orientation-sensitive features. To suppress noise and extract higher-level abstractions, the concatenated tensor is processed by a lightweight convolutional neural network consisting of two 3 × 3 convolutional layers with ReLU activation, followed by a 1 × 1 convolution for channel compression. This lightweight design reduces network depth and width while maintaining effective directional feature extraction, thereby improving the overall computational efficiency of the model. The resulting encoded gradient feature map is given by Eq. (13).13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{F}}_{{{\mathrm{grad}}}} = {\text{ C}}_{{{\mathrm{grad}}}} \left( {\mathrm{G}} \right)$$\end{document} where Cgrad denotes the lightweight gradient CNN. Similar to the frequency domain, the CNN encoder in the gradient domain is deliberately kept shallow, consisting of only two convolutional layers followed by a 1 × 1 projection, ensuring minimal parameter overhead. To align with the multi-scale hierarchy of the YOLOv8 spatial stream (P3, P4, P5), the encoded gradient features undergo resolution-adaptive resizing / downsampling and 1 × 1 channel adjustment, producing three gradient feature maps G3, G4, and G5 at resolutions 80 × 80, 4 × 40, and 20 × 20, respectively. These maps match the spatial resolution and channel dimensionality of their spatial and frequency counterparts and are forwarded to the Adaptive Triple-Domain Fusion module. The gradient branch initially preserves the full spatial resolution of the input image. After applying eight Gabor filters, the response maps are concatenated to form a tensor of size 640 × 640 × 8, which is then processed by a lightweight CNN encoder to produce a feature map of size 640 × 640×C. This feature map is subsequently resized to match the YOLOv8 detection scales (P3, P4, P5), generating three aligned representations of 80 × 80×C, 40 × 40×C, and 20 × 20×C. This step ensures dimensional compatibility with the spatial and frequency streams without introducing unnecessary intermediate upsampling. By modeling directional edges and gradient information, the gradient stream significantly enhances the model’s sensitivity to elongated, oriented, and fine-grained defects that are challenging for spatial-domain or frequency-domain approaches. When integrated with spatial and frequency features through adaptive fusion, these gradient features enable a more comprehensive and discriminative characterization of aluminum surface defects under real-world industrial conditions. Algorithm‌‌‌‌‌‌‌ 4 presents the gradient stream processing. Algorithm 4Gradient-CNN feature extraction. Gradient-CNN feature extraction. The structure of the Gradient-CNN model is illustrated in Fig. 4. Fig. 4Gradient‑CNN model structure. Gradient‑CNN model structure. Adaptive triple-domain feature fusion The proposed adaptive triple-domain fusion module integrates spatial-domain, frequency-domain, and gradient-domain features within a unified framework. It employs an attention-based weighting mechanism that dynamically determines the contribution of each domain based on image content and defect-specific characteristics, enabling discriminative and context-aware feature aggregation. At each scale i ∈ {3, 4, 5}, the module receives three scale-aligned feature maps: the spatial-domain features Pi from the YOLOv8 backbone, frequency-domain features Fi from the Wavelet-CNN stream, and gradient-domain features Gi from the Gabor-CNN stream, corresponding to small, medium, and large defect patterns. To enable concatenation and weighted fusion, the frequency-domain and gradient-domain features are projected using 1 × 1 convolutions to match the channel dimension C of the spatial stream. The domain-specific features are then concatenated along the channel dimension, as expressed in Eq. (14).14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{U}}_{{\mathrm{i}}} = {\mathrm{Concat}}({\mathrm{P}}_{{\mathrm{i}}} ,{\mathrm{F}}_{{\mathrm{i}}} ,{\mathrm{G}}_{{\mathrm{i}}} ),~~~{\mathrm{U}}_{{\mathrm{i}}} {\text{ }}({\mathrm{H}}_{{\mathrm{i}}} \times {\mathrm{W}}_{{\mathrm{i}}} \times {\mathrm{3C}})$$\end{document} The aggregated tensor Ui contains heterogeneous information from the three complementary domains. It is compressed into a compact channel descriptor using global average pooling (GAP), which produces a one-dimensional vector zi(3 C). This operation provides a global summary of the concatenated feature maps while avoiding the instability and computational cost associated with high-dimensional representations. The descriptor zi is then fed into a lightweight two-layer multilayer perceptron (MLP), as defined in Eq. (15).15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$~{\mathrm{z}}_{{\mathrm{i}}} = {\mathrm{GAP}}({\mathrm{U}}_{{\mathrm{i}}} ),~~{\mathrm{z}}_{{\mathrm{i}}} ({\mathrm{3C}})$$\end{document} The MLP is formulated as shown in Eqs. (16) and (17).16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{h}}_{{\mathrm{i}}} = {\text{ ReLU}}\left( {{\mathrm{W}}_{{\mathrm{1}}} {\mathrm{z}}_{{\mathrm{i}}} {\text{ }} + {\text{ b}}_{{\mathrm{1}}} } \right)$$\end{document} 17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{w}}_{{\mathrm{i}}} = {\text{ W}}_{{\mathrm{2}}} {\mathrm{h}}_{{\mathrm{i}}} + {\text{ b}}_{{\mathrm{2}}} ~$$\end{document} where W1(d×3 C), W2(3×d), and d denotes the hidden-layer dimension. In our implementation, d = 128, which provides a suitable balance between computational cost and representation capacity. The output vector wi is normalized using a softmax function to generate the domain credibility weights as shown in Eq. (18).18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$~[\alpha _{{\mathrm{i}}} ,\beta _{{\mathrm{i}}} ,\gamma _{{\mathrm{i}}} ] = {\mathrm{Softmax}}({\mathrm{w}}_{{\mathrm{i}}} )~$$\end{document} Where αi, βi, and γi represent the credibility weights of the spatial-domain, frequency-domain, and gradient-domain at scale i, respectively. These weights satisfy the constraint shown in Eq. (19).19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha _{{\mathrm{i}}} + \beta _{{\mathrm{i}}} + \gamma _{{\mathrm{i}}} = {\mathrm{1}}~~$$\end{document} These weights are shared across all spatial locations and channels. This domain-level weighting significantly reduces computational cost while allowing the network to emphasize the most informative domain according to the global defect characteristics of the input image. To ensure stable training and prevent gradient vanishing or weight collapse, several design strategies are adopted. First, the MLP is kept shallow, ensuring stable gradient propagation. Second, the softmax function restricts the weights to a probability simplex, preventing dominance of a single feature domain. Finally, the fusion module benefits from the residual pathways of the YOLOv8 backbone, which help maintain stable gradients throughout training. The fused feature map at scale i is computed as shown in Eq. (20).20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F_{{fused}} ~i = \alpha _{i} p_{i} + \beta _{i} F_{i} ~ + \gamma _{i} ~G_{i}$$\end{document} The scalar weights are broadcast across spatial dimensions, enabling the module to adaptively emphasize the most informative domain at each level of abstraction. The fusion process is performed independently at the three scales, producing the fused feature maps Ffused3, Ffused4, and Ffused5. A key advantage of this adaptive strategy is its ability to automatically identify the dominant feature domain for different defect types. For example, elongated and oriented defects, such as scratches, rolling marks, benefit from gradient-domain features; low-contrast or texture-dominated anomalies rely more heavily on frequency-domain cues; and defects with clear geometric boundaries are better captured by spatial-domain features. Unlike conventional channel or spatial attention mechanisms, such as SE-Net and CBAM30,50, which operate within a single feature map, the proposed mechanism operates across domains and determines the relative importance of spatial-domain, frequency-domain, and gradient-domain features. The combination of GAP and a lightweight MLP provides an efficient global weighting mechanism for predicting domain-level importance coefficients with minimal computational overhead. In contrast to earlier frequency-enhanced YOLO variants that use fixed or predetermined fusion rules, the proposed module adaptively learns domain-specific fusion weights, enabling the network to emphasize gradient cues for elongated defects and frequency-domain cues for subtle texture irregularities. This results in more flexible and context-aware feature integration. The fused multi-domain features are subsequently fed into the standard YOLOv8 PAN-FPN neck for multi-scale feature refinement and final defect detection. Algorithm 5 summarizes the proposed adaptive triple-domain fusion process. Algorithm 5Adaptive Triple-Domain Feature Fusion. Adaptive Triple-Domain Feature Fusion. Figure 5 illustrates the structure of the proposed Adaptive Triple-Domain Feature Fusion module. Fig. 5Structure of the proposed adaptive triple-domain feature fusion module. Structure of the proposed adaptive triple-domain feature fusion module. Table 2 summarizes the parallel multi-domain feature extraction strategy used in the proposed framework. The spatial-domain stream employs the YOLOv8 backbone to extract features P3, P4, and P5. In parallel, the frequency-domain stream, based on wavelet transformation followed by a lightweight CNN, produces multi-scale features F3, F4, and F5. The gradient-domain stream uses multi-directional Gabor filtering and a lightweight CNN to extract directional edge-aware features G3, G4, and G5, which are particularly effective for elongated and oriented defects. These multi-domain features collectively serve as the inputs to the adaptive fusion module. Table 2Triple-domain parallel feature extraction streams in the proposed method.Stream (Domain)Processing ModuleMulti-scale FeaturesSpatialYOLOv8 backboneP3, P4, P5FrequencyWavelet + Lightweight CNNF3, F4, F5GradientGabor Filter + Lightweight CNNG3, G4, G5 Table 2Triple-domain parallel feature extraction streams in the proposed method.Stream (Domain)Processing ModuleMulti-scale FeaturesSpatialYOLOv8 backboneP3, P4, P5FrequencyWavelet + Lightweight CNNF3, F4, F5GradientGabor Filter + Lightweight CNNG3, G4, G5 Triple-domain parallel feature extraction streams in the proposed method. Multi-scale feature enhancement with PAN-FPN neck Following the adaptive triple-domain fusion, the feature maps Ffused3, Ffused4, and Ffused5 are fed into the YOLOv8 PAN-FPN neck. The primary role of this stage is to further enhance and integrate multi-scale through a bidirectional information flow that propagates semantic context downward and fine-grained spatial details upward. By combining top-down and bottom-up pathways, PAN-FPN alleviates the limitations of the traditional Feature Pyramid Network (FPN) and improves detection performance across different scales. In the top-down path, the coarsest feature Ffused5 (20 × 20) is first processed by a 1 × 1 convolution to align channels, then upsampled to 40 × 40 via nearest-neighbor upsampling. The upsampled feature is concatenated with the mid-level feature Ffused4 and passed through a C2f block for further refinement. This process is repeated to produce the refined feature Ptd4, as shown in Eq. (21).21\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{P}}_{{{\mathrm{td}}}} {\mathrm{4}} = {\mathrm{C2f}}({\mathrm{Concat}}({\mathrm{F}}_{{{\mathrm{fused}}}} {\mathrm{4}},{\mathrm{Upsampl}}({\mathrm{Conv}}_{{1 \times 1}} ({\mathrm{P}}_{{{\mathrm{td}}}} {\mathrm{5}}))))$$\end{document} In the bottom-up path, the enhanced fine-grained feature Ptd3 is downsampled to 40 × 40 using a stride-2 convolution and then merged with the mid-level feature Ptd4. The merged result is further processed by a C2f block, as shown in Eq. (22).22\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{P}}_{{{\mathrm{out}}}} {\mathrm{4}} = {\mathrm{C2f}}\hbox{-}({\mathrm{Concat}}({\mathrm{P}}_{{{\mathrm{td}}}} {\mathrm{4}},{\mathrm{Conv}} {\mathrm{Conv}}_{{3 \times 3's = 2 - }} ({\mathrm{P}}_{{{\mathrm{td}}}} {\mathrm{3}})))~$$\end{document} This procedure is repeated for the coarsest level, ultimately yielding three final feature maps Pout3, Pout4, and Pout5. A key advantage of the proposed architecture is that the inputs to the PAN-FPN neck result from adaptive fusion across the spatial, frequency, and gradient domains. This provides the neck with more diverse and discriminative multi-scale information, improving the detection of fine-grained, low-contrast, and complex defects in aluminum profiles. The resulting features are directly forwarded to the YOLOv8 detection head for final prediction. Algorithm‌‌‌‌‌‌‌ 6 outlines the multi‑scale feature enhancement process in the PAN-FPN neck. Algorithm 6Multi-Scale Feature Enhancement with the PAN-FPN Neck. Multi-Scale Feature Enhancement with the PAN-FPN Neck. Figure 6 illustrates the structure of the YOLOv8 PAN-FPN neck. Fig. 6Structure of the YOLOv8 PAN-FPN neck. Structure of the YOLOv8 PAN-FPN neck. Defect detection head In the final stage of the proposed architecture, the enhanced multi-scale feature maps Pout3, Pout4, and Pout5 produced by the PAN-FPN neck, are fed into the YOLOv8 detection head. The proposed framework retains the original anchor-free detection mechanism of YOLOv8, which predicts object locations directly from feature map points without relying on predefined anchor boxes. This design simplifies the detection process and improves generalization while reducing anchor-related hyperparameters. For each scale level i ∈ {3, 4, 5}, the feature map Pouti is first processed by a 3 × 3 convolutional layer and then passed to a decoupled head with to two parallel branches: a bounding-box regression branch and a classification branch. Regression branch. The regression branch predicts the distances from each feature-map location to the four sides of the bounding box. For each grid location (x, y) on the feature map, the network outputs a distance vector d = (dl, dt, dr, db), where dl, dt, dr, and db denote the distances from the point to the left, top, right, and bottom sides of the predicted bounding box, respectively. The bounding-box coordinates are obtained using Eqs. (23)–(26).23\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{x}}_{{{\mathrm{min}}}} = {\mathrm{x}} - {\mathrm{dl}}$$\end{document} 24\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{y}}_{{{\mathrm{min}}}} = {\mathrm{y}} - {\mathrm{dt}}$$\end{document} 25\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{x}}_{{{\mathrm{max}}}} = {\mathrm{x}} + {\mathrm{dr}}$$\end{document} 26\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{y}}_{{{\mathrm{max}}}} = {\mathrm{y}} + {\mathrm{db}}$$\end{document} To improve localization accuracy, YOLOv8 adopts Distribution Focal Loss (DFL) to model the bounding-box offsets as discrete probability distributions. The final distance prediction is computed as the expectation of the distribution, as shown in Eq. (27).27\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:\mathrm{d}=\:\sum\:_{\mathrm{i}=0}^{\mathrm{K}}{\mathrm{p}}_{\mathrm{i}}\times\:\mathrm{i}$$\end{document} where pi represents the probability of the i-th discrete bin predicted by the regression branch. Classification branch. The classification branch outputs a tensor of size Hl×Wl×C, where C represents the number of defect categories. Each location predicts class probabilities using a sigmoid activation. Since YOLOv8 follows an anchor-free design, no separate objectness branch is required, and the classification scores directly indicate the confidence of defect presence. Predictions from the three scales are aggregated and refined using Non-Maximum Suppression (NMS) to remove redundant detections. NMS iteratively selects the highest-confidence bounding boxes and suppresses overlapping candidates whose Intersection-over-Union (IoU) values exceed a predefined threshold. The final output consists of a set of bounding boxes \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{B}\:=\left\{\mathrm{b}\mathrm{i}\text{}\right\}}_{i=1}^{N}$$\end{document}, their corresponding class labels \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{C}\:=\:\left\{\mathrm{c}\mathrm{i}\text{}\right\}}_{i=1}^{N}$$\end{document}, and confidence scores \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{S}\:=\left\{\mathrm{s}\mathrm{i}\text{}\right\}}_{i=1}^{N}$$\end{document}. The NMS process uses an IoU threshold of 0.5 to suppress highly overlapping bounding boxes. During inference, a confidence threshold of 0.25 is applied to filter low-confidence predictions, and the maximum number of detections per image is limited to 300 following the standard YOLOv8 configuration. By combining the anchor-free YOLOv8 head with the proposed multi-domain feature representations, the framework achieves accurate and efficient detection of diverse aluminum surface defects. The training objective and loss formulation used for optimizing the proposed network are described in Sect. 3.7. Algorithm‌‌‌‌‌‌‌ 7 outlines the defect detection and classification process in the detection head. Algorithm 7Defect detection head. Defect detection head. Figure 7 illustrates the architecture of the defect detection head. Fig. 7Structure of the YOLOv8 detection head. Structure of the YOLOv8 detection head. Training objective and loss function Following the original YOLOv8 formulation, the proposed network is trained using the standard YOLOv8 detection loss. The architectural modifications introduced in this work primarily focus on feature extraction and multi-domain fusion, while the detection head and its associated training objective remain unchanged. Therefore, the same loss formulation used in YOLOv8 is adopted for training. The overall loss function consists of three components: the bounding-box regression loss, the classification loss, and the Distribution Focal Loss (DFL) used for precise localization. The total loss is defined in Eq. (28).28\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{L}}_{{{\mathrm{total}}}} = {{~\lambda }}_{{{\mathrm{box}}}} {\mathrm{L}}_{{{\mathrm{CIoU}}}} + {{~\lambda }}_{{{{cls}}}} {\mathrm{L}}_{{{\mathrm{cls}}}} + {{~\lambda }}_{{{\mathrm{dfl}}}} {\mathrm{L}}_{{{\mathrm{DFL}}}}$$\end{document} where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{L}}_{\mathrm{C}\mathrm{I}\mathrm{o}\mathrm{U}}$$\end{document} denotes the Complete Intersection-over-Union (CIoU) loss used for bounding-box regression, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{L}}_{\mathrm{c}\mathrm{l}\mathrm{s}}$$\end{document} represents the binary cross-entropy loss for defect classification, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{L}}_{\mathrm{D}\mathrm{F}\mathrm{L}}$$\end{document} corresponds to the Distribution Focal Loss used to refine the predicted bounding-box offsets. The weighting coefficients balance the contribution of each loss component during training. Following the standard YOLOv8 configuration, the weights are set to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\uplambda\:}}_{box}=7.5$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\uplambda\:}}_{cls}=0.5$$\end{document}, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{{\uplambda\:}}_{dfl}=1.5$$\end{document}. Since the proposed architecture modifies only the feature extraction and fusion modules while preserving the original YOLOv8 detection head, the same loss formulation is adopted without introducing additional fusion-specific loss terms. Figure 8 illustrates the overall architecture of the proposed Adaptive Triple-Domain YOLOv8 framework, which integrates spatial (image), frequency (wavelet), and gradient (Gabor) feature representations through an attention-based fusion module for robust aluminum surface defect detection. Fig. 8Overall architecture of the Adaptive Triple-Domain YOLOv8. Overall architecture of the Adaptive Triple-Domain YOLOv8. The architecture integrates three parallel domain-specific streams, namely spatial, wavelet-frequency, and Gabor-gradient streams, and combines them through an adaptive attention-based fusion module to provide a comprehensive multi-domain representation for aluminum surface defect detection. Experimental results and analysis This section presents a comprehensive evaluation of the proposed Adaptive Triple‑Domain YOLOv8 framework. We first describe the experimental setup, dataset, and evaluation metrics. Then, we conduct comparative experiments, ablation studies, and class‑wise performance analysis to validate the effectiveness and efficiency of our method. Experimental data and conditions The following subsections describe the hardware and software environment, the dataset used for training and evaluation, and the performance metrics adopted to evaluate the proposed model. Experimental environment All experiments were conducted using PyTorch 2.0 as the deep learning framework. Training and inference were performed on an NVIDIA RTX 3090 GPU with CUDA 11.7 and an Intel Core i7-12700 K CPU running Ubuntu 20.04 LTS. Models were initialized with ImageNet-pretrained weights, and the AdamW optimizer was employed with an initial learning rate of 1 × 10⁻³, a weight decay of 5 × 10⁻⁴, and a cosine annealing learning rate scheduler. Input images were consistently resized to 640 × 640 pixels using the letterbox strategy. A batch size of 16 was applied throughout training, and each model was trained for 300 epochs. To enhance generalization and robustness, standard data augmentation techniques such as Mosaic augmentation, random scaling, horizontal flipping, and color jittering were incorporated during the training process. During training and inference, the detection settings followed the standard YOLOv8 configuration. The confidence threshold was set to 0.25, and the Non-Maximum Suppression (NMS) threshold was set to 0.50 to remove redundant bounding boxes. The maximum number of detections per image was limited to 300 following the standard YOLOv8 inference configuration. The training objective followed the default YOLOv8 loss formulation, which combines CIoU loss for bounding-box regression, Binary Cross-Entropy (BCE) loss for classification, and Distribution Focal Loss (DFL) for improved bounding-box localization. Dataset description All experiments were conducted on the Tianchi Aluminum Profile Surface Defect Dataset, a widely used public benchmark specifically designed for evaluating surface inspection methods in aluminum profile manufacturing. This dataset consists of high-resolution grayscale industrial images captured under realistic production conditions, and includes a diverse range of defect categories, such as scratches, rolling marks, oxidation, oil stains, cracks, pits, and non-conductive regions51. After preprocessing and data cleaning, a total of 10,500 images were used in this study. These images include various challenging conditions such as illumination variations, reflective surfaces, and complex background patterns commonly observed in industrial environments. The dataset provides a comprehensive benchmark for evaluating the robustness and generalization ability of the proposed method. Dataset preparation and class distribution The resulting dataset includes nine distinct defect categories: longitudinal scratch, transverse scratch, rolling mark, non-conductive, oil stain, oxidation, crack, pit, and edge damage. To ensure balanced evaluation, the dataset was divided on a class-wise basis into training, validation, and testing subsets with a fixed ratio of 70%, 15%, and 15%, respectively. A stratified splitting strategy was used to preserves balanced class distributions across all subsets. This approach ensures a fair evaluation of the model while reflecting the diversity and complexity of real industrial inspection scenarios. Bounding boxes are annotated only for defective regions, while all remaining areas are treated as normal background during training. The dataset was split at the image level, ensuring that no images are shared between the training, validation, and testing subsets, thereby preventing any potential data leakage. The class-wise distribution of samples in each subset is summarized in Table 3, and examples of typical image types are shown in Fig. 9. Table 3Class-wise distribution of samples in the dataset.Defect ClassDomain TypeTrainingValidationTestingLongitudinal ScratchGradient980210210Transverse ScratchGradient840180180Rolling MarkGradient910195195Non-ConductiveFrequency840180180Oil StainFrequency770165165OxidationFrequency770165165CrackGradient700150150PitSpatial770165165Edge DamageSpatial770165165 Table 3Class-wise distribution of samples in the dataset.Defect ClassDomain TypeTrainingValidationTestingLongitudinal ScratchGradient980210210Transverse ScratchGradient840180180Rolling MarkGradient910195195Non-ConductiveFrequency840180180Oil StainFrequency770165165OxidationFrequency770165165CrackGradient700150150PitSpatial770165165Edge DamageSpatial770165165 Class-wise distribution of samples in the dataset. Fig. 9Examples of image types in the dataset. Examples of image types in the dataset. Evaluation metrics To thoroughly assess the detection performance, robustness, and computational efficiency of the proposed Adaptive Triple-Domain YOLOv8 framework, a comprehensive set of quantitative metrics was employed. These metrics assess detection precision, speed, and real-time suitability, enabling a comparison with existing approaches. In this study, all evaluation metrics are defined in the context of object detection, where defect instances are evaluated using bounding boxes on aluminum profile surfaces. A predicted box is considered a true positive if its Intersection-over-Union (IoU) with the corresponding ground-truth box exceeds a specified threshold; otherwise, it is counted as a false positive, while unmatched ground-truth boxes are treated as false negatives. Precision, recall, and F1-score are computed based on these definitions. The mAP@0.5 metric is calculated at an IoU threshold of 0.50, and mAP@0.5:0.95 is obtained by averaging AP over IoU thresholds from 0.50 to 0.95 with a step of 0.05. These criteria ensure a clear and consistent interpretation of the reported performance values. Precision. Precision measures the proportion of correctly identified defects among all predicted detections and is defined in Eq. (29).29\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Precision}} = {{~}}\frac{{{\mathrm{TP}}}}{{{\mathrm{TP}} + {\mathrm{FP}}}}$$\end{document} where TP and FP denote the numbers of true positives and false positives, respectively. Recall. Recall measures the ability of the model to detect all actual defects and is defined in Eq. (30).30\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Recall}} = {{~}}\frac{{{\mathrm{TP}}}}{{{\mathrm{TP}} + {\mathrm{FN}}}}$$\end{document} where FN denotes the number of false negatives. F1-Score. The F1-score provides the harmonic mean of precision and recall, making it suitable for evaluating the balance between missed detections and false alarms, particularly for low-contrast and small-scale defects. It is computed using Eq. (31).31\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{F}}1 = {{~}}\frac{{2 \times {\mathrm{Precision}} \times {\mathrm{Recall}}}}{{{\mathrm{Precision}} + {\mathrm{Recall}}}}$$\end{document} mean Average Precision (mAP). Mean Average Precision (mAP) is widely used as a primary indicator of detection accuracy in object detection tasks. It is defined as the mean Average Precision over all defect classes, as shown in Eq. (32).32\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{mAP}} = {\mathrm{~}}\frac{1}{{\mathrm{C}}}{\mathrm{~}}\mathop \sum \limits_{{{\mathrm{c}} = 1}}^{{\mathrm{C}}} {\mathrm{AP}}_{{\mathrm{c}}}$$\end{document} where APc denotes the area under the precision–recall curve for class c, and C is the total number of defect classes. In this study, both mAP@0.5 and mAP@0.5:0.95 are used to evaluate performance under lenient (IoU ≥ 0.50) and stricter localization criteria (IoU from 0.50 to 0.95), respectively. Inference Speed (FPS). Inference speed is measured in Frames Per Second (FPS) to evaluate the real-time applicability of the proposed model and is defined in Eq. (33).33\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{FPS}} = {{~}}\frac{{{\mathrm{N}}_{{{\mathrm{images}}}} }}{{{\mathrm{T}}_{{{\mathrm{total}}}} }}$$\end{document} where Nimages is the number of processed images and Ttotal denotes the total inference time. Ablation Performance Metrics. For the ablation study, the relative performance gain of the proposed method over the baseline is defined in Eq. (34).34\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\Delta mAP}} = {{~}}\frac{{{\mathrm{mAP}}_{{{\mathrm{proposed}}}} - {\mathrm{mAP}}_{{{\mathrm{baseline}}}} }}{{{\mathrm{mAP}}_{{{\mathrm{baseline}}}} }}~ \times 100\%$$\end{document} This metric highlights the individual and combined contributions of the spatial, frequency, and gradient domains. Number of Parameters (Params). The number of parameters (Params) reflects the model size, memory footprint, and storage requirement. For convolutional layers, the total number of trainable parameters is estimated by Eq. (35).35\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Params}} = {\mathrm{~}}\mathop \sum \limits_{{{\mathrm{l}} = 1}}^{{\mathrm{L}}} \left( {{\mathrm{K}}_{{\mathrm{l}}}^{2} \times {\mathrm{~C}}_{{\mathrm{l}}}^{{{\mathrm{in}}}} \times {\mathrm{~C}}_{{\mathrm{l}}}^{{{\mathrm{out}}}} + {\mathrm{~C}}_{{\mathrm{l}}}^{{{\mathrm{out}}}} {\mathrm{~}}} \right)$$\end{document} where L denotes the total number of convolutional layers, Kl is the kernel size of layer l, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{C}}_{\mathrm{l}}^{\mathrm{i}\mathrm{n}}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{C}}_{\mathrm{l}}^{\mathrm{o}\mathrm{u}\mathrm{t}}$$\end{document} are the numbers of input and output channels, respectively. Floating-Point Operations (FLOPs). FLOPs measure the total number of arithmetic operations required for a single forward pass and reflect the computational burden of the model. They are estimated by Eq. (36).36\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{FLOPs}} = {\mathrm{~}}\mathop \sum \limits_{{{\mathrm{l}} = 1}}^{{\mathrm{L}}} \left( {{\mathrm{H}}_{{\mathrm{l}}} \times {\mathrm{~W}}_{{\mathrm{l}}} \times {\mathrm{~K}}_{{\mathrm{l}}}^{2} \times {\mathrm{~C}}_{{\mathrm{l}}}^{{{\mathrm{in}}}} \times {\mathrm{~C}}_{{\mathrm{l}}}^{{{\mathrm{out}}}} {\mathrm{~}}} \right)$$\end{document} where Hl and Wl denote the height and width of the output feature map at layer l. Training Time per Epoch. Training time per Epoch reflects the computational cost required to update the model parameters over one full pass through the training set. The training time per epoch is defined as Eq. (37).37\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:{\mathrm{T}}_{\mathrm{e}\mathrm{p}\mathrm{o}\mathrm{c}\mathrm{h}}=\:\sum\:_{\mathrm{b}=1}^{\mathrm{B}}{\mathrm{t}}_{\mathrm{b}}$$\end{document} where B is the total number of mini-batches and tb denotes the processing time of batch b. This metric directly reflects the training efficiency and scalability of the model in practical industrial environments. Multi-domain comparative analysis To comprehensively evaluate the effectiveness of the proposed Adaptive Triple-Domain YOLOv8 framework, a series of comparative experiments were conducted by comparing it with carefully selected baseline models derived from the same architectural family. Specifically, the following four model variants were constructed and compared: Baseline YOLOv8 (Spatial) the standard YOLOv8 detector relying exclusively on spatial-domain image features. Dual-Domain YOLOv8 (Spatial + Frequency) an enhanced variant incorporating a wavelet-based frequency branch with dual-domain fusion, designed to isolate the impact of frequency-domain features. Dual-Domain YOLOv8 (Spatial + Gradient) a variant equipped with a Gabor-based gradient branch, allowing the evaluation of gradient-domain directional information. Adaptive Triple-Domain YOLOv8 (Spatial + Frequency + Gradient) the complete proposed model, which jointly integrates spatial, frequency, and gradient features through an adaptive attention-based fusion mechanism. This systematic experimental design enables a clear investigation of how each additional domain contributes to detection accuracy while affecting inference speed and real-time efficiency. The results provide strong evidence that the explicit modeling of complementary spatial, frequency, and gradient features substantially enhances the detection of subtle, low-contrast, and elongated defects on aluminum surfaces while maintaining high computational efficiency suitable for industrial deployment. Efficiency definition and computational characterization In this work, the term efficient refers to a model that maintains strong detection accuracy with relatively low computational cost. This property is evaluated using three common efficiency indicators: the number of trainable parameters, computational cost measured by FLOPs, and the inference speed measured in FPS, which together reflect model compactness, processing cost, and real-time suitability. The proposed Triple-Domain YOLOv8 contains 14.9 M parameters, requires 35.6 G FLOPs, and achieves an inference speed of 103 FPS. For comparison, Lightweight YOLOv818 uses fewer parameters (9.3 M) but achieves lower detection accuracy, whereas more complex models, such as MCH YOLOv1237 require 17.3 M parameters and 45.8 G FLOPs and operate at a lower inference speed of 97 FPS. This places the proposed model between compact and higher-capacity architectures, achieving a favorable trade-off between computational cost and detection accuracy. These results, consistent with the comparisons reported later in Table 10, indicate that the proposed architecture achieves a balanced trade-off among model size, computational complexity, and detection accuracy. For clearer reference, Table 4 compares the proposed model with several standard YOLOv8 variants, namely YOLOv8n, YOLOv8s, YOLOv8m, and YOLOv8l, which are widely used baseline configurations15,52. Compared with the standard YOLOv8 configurations listed in Table 4, the proposed model introduces a moderate increase in model capacity relative to the compact baseline variant. The parameter count increases from 11.2 M to 14.9 M due to the integration of frequency and gradient domain branches, corresponding to an approximate 33% increase. Despite this addition, the model remains considerably smaller than higher-capacity configurations while enabling richer multi-domain feature representations. Consequently, the architecture maintains competitive computational complexity and high inference speed, indicating an effective balance between parameter cost and detection performance while demonstrating favorable parameter efficiency compared with larger YOLOv8 variants. Table 4Computational complexity comparison between the proposed model and standard YOLOv8 variants.ModelParams (M)FLOPs (G)FPSYOLOv8n3.28.7165YOLOv8s11.228.6142YOLOv8m25.978.998YOLOv8l4316570Proposed Adaptive Triple-Domain YOLOv814.935.6103 Table 4Computational complexity comparison between the proposed model and standard YOLOv8 variants.ModelParams (M)FLOPs (G)FPSYOLOv8n3.28.7165YOLOv8s11.228.6142YOLOv8m25.978.998YOLOv8l4316570Proposed Adaptive Triple-Domain YOLOv814.935.6103 Computational complexity comparison between the proposed model and standard YOLOv8 variants. Table 4 compares the computational complexity of the proposed model with several standard YOLOv8 variants. YOLOv8n provides the smallest parameter count but limited model capacity, whereas YOLOv8s offers a moderate balance between accuracy and complexity, and YOLOv8m significantly increases computational cost. The proposed Triple-Domain YOLOv8 incorporates additional frequency and gradient branches while maintaining a parameter count of 14.9 M, which is close to YOLOv8s and substantially lower than those of larger variants. Its computational cost of 35.6 G FLOPs also remains well below that of heavier configurations while sustaining real-time inference at 103 FPS. These results demonstrate that the proposed architecture preserves the efficiency advantages of YOLO-based detectors while benefiting from richer multi-domain feature representations. Quantitative comparison of detection performance To rigorously evaluate the effectiveness of the proposed Triple-Domain YOLOv8 framework, a comprehensive quantitative comparison was performed using standardized performance metrics. The results of all comparison methods were obtained from their published sources, reported under the same dataset and comparable experimental settings on the Tianchi dataset. The evaluation focuses on both detection accuracy and real-time feasibility, reporting Precision, Recall, F1-score, mAP@0.5, mAP@0.5:0.95, and inference speed (FPS). These metrics collectively provide a comprehensive assessment of localization precision, recall reliability, overall detection quality, and practical deployment feasibility. Table 5 presents the results, showing that the proposed Triple-Domain YOLOv8 achieves higher detection performance than the spatial and dual-domain baselines. (P, F, and G denote the spatial, frequency, and gradient domains, respectively.) Table 5Quantitative Comparison on the Tianchi Aluminum Profile Surface Defect Dataset.Method P FGPrecision (%)Recall (%)F1- Score(%)mAP@0.5 (%)mAP@0.5:0.95 (%)FPS > 100YOLOv8 (baseline)✔⨯⨯90.887.989.385.560.9148Dual-YOLOv8-PF✔✔⨯93.190.391.789.765.2123Dual-YOLOv8-PG✔⨯✔93.691.092.392.366.4119YOLOv12(baseline)✔⨯⨯94.291.792.993.868104Triple-Domain YOLOv8✔✔✔96.794.595.296.773.2103 Table 5Quantitative Comparison on the Tianchi Aluminum Profile Surface Defect Dataset.Method P FGPrecision (%)Recall (%)F1- Score(%)mAP@0.5 (%)mAP@0.5:0.95 (%)FPS > 100YOLOv8 (baseline)✔⨯⨯90.887.989.385.560.9148Dual-YOLOv8-PF✔✔⨯93.190.391.789.765.2123Dual-YOLOv8-PG✔⨯✔93.691.092.392.366.4119YOLOv12(baseline)✔⨯⨯94.291.792.993.868104Triple-Domain YOLOv8✔✔✔96.794.595.296.773.2103 Quantitative Comparison on the Tianchi Aluminum Profile Surface Defect Dataset. As shown in Table 5, the proposed Triple-Domain YOLOv8 achieves the highest overall detection performance, reaching 96.7% mAP@0.5 and 73.2% mAP@0.5:0.95, while maintaining real-time inference at 103 FPS. This represents substantial improvements over the spatial-only YOLOv8 baseline (+ 5.9% mAP@0.5) and the dual-domain variants (+ 3.5% and + 2.8% mAP@0.5 for P + F and P + G, respectively). Even when compared to the YOLOv12 baseline, the proposed model delivers a notable gain of + 1.8% mAP@0.5 with only marginal reduction in inference speed, confirming its improved accuracy-efficiency trade-off. These results highlight the effectiveness value of adaptively integrating spatial, frequency, and gradient features for high-precision defect detection in challenging industrial environments. Class-wise performance analysis To further investigate the defect-specific effectiveness of multi-domain modeling, Table 6 presents the class-wise mAP@0.5 results for the evaluated models. This analysis provides insight into the defect-specific performance of the proposed Triple-Domain YOLOv8, demonstrating substantial improvements across all categories, particularly for challenging defects characterized by strong orientations (e.g., scratches and cracks), complex texture patterns, or inherently low contrast. Table 6Class-wise detection performance on aluminum profile defects using mAP@0.5 (%).Defect ClassYOLOv8 (P)YOLOv8 (P + F)YOLOv8 (P + G)YOLOv8(P + G+F)Longitudinal Scratch84.389.193.5 97.5 Transverse Scratch83.788.592.7 96.8 Rolling Mark82.987.492.2 96.3 Non-Conductive87.693.893.0 97.2 Oil Stain88.994.693.8 97.9 Oxidation86.892.792.2 96.6 Crack81.486.991.9 95.7 Pit84.689.391.3 95.8 Edge Damage85.789.892.2 96.2 Mean mAP 85.5 89.7 92.3 96.7 Table 6Class-wise detection performance on aluminum profile defects using mAP@0.5 (%).Defect ClassYOLOv8 (P)YOLOv8 (P + F)YOLOv8 (P + G)YOLOv8(P + G+F)Longitudinal Scratch84.389.193.5 97.5 Transverse Scratch83.788.592.7 96.8 Rolling Mark82.987.492.2 96.3 Non-Conductive87.693.893.0 97.2 Oil Stain88.994.693.8 97.9 Oxidation86.892.792.2 96.6 Crack81.486.991.9 95.7 Pit84.689.391.3 95.8 Edge Damage85.789.892.2 96.2 Mean mAP 85.5 89.7 92.3 96.7 Class-wise detection performance on aluminum profile defects using mAP@0.5 (%). As demonstrated in Table 6, the proposed Triple-Domain YOLOv8 achieves the highest detection accuracy across all evaluated defect categories. The most substantial gains are observed for elongated and oriented defects, such as longitudinal and transverse scratches, rolling marks, and cracks as well as low-contrast and texture-dominated anomalies, such as non-conductive, oil stain, and oxidation. This underscores the value of integrating spatial, frequency, and gradient features. Compared to the spatial-only YOLOv8 baseline, the proposed model delivers an average absolute improvement of + 11.2% in mAP@0.5, demonstrating the effectiveness of joint multi-domain modeling for addressing the heterogeneous and challenging nature of industrial aluminum surface defects. The performance gains observed across different defect types can be explained by the complementary characteristics of the three feature domains. Spatial-domain features preserve the global structural layout of defects, enabling accurate localization. Frequency-domain representations enhance the visibility of periodic textures and low-contrast surface irregularities that are difficult to capture using spatial-domain features. Gradient-domain information emphasizes edge continuity and directional transitions, making the model more effective in detecting elongated or orientation-dependent defects. By jointly leveraging these complementary cues, the proposed Triple-Domain YOLOv8 detector constructs a richer and more discriminative feature representation, which explains its consistently superior performance across all defect categories. Ablation study A structured ablation study was conducted to isolate and quantify the contribution of each feature domain to the overall performance of the proposed framework. Six architectural variants were evaluated under the same input resolution (640 × 640), optimizer configuration, batch size, and training epochs. This controlled setup reduces confounding factors and enables a clearer assessment of the contribution of different feature-domain combinations. Table 7. Ablation study of feature-domain combinations on the Tianchi aluminum profile defect dataset. Table 7Ablation study on Tianchi aluminum profile defect dataset.Model VariantSpatial (P)Frequency (F)Gradient (G)mAP@0.5:0.95 (%)mAP@0.5 (%)ΔmAP(%)FPS > 100YOLOv8 (P)✔⨯⨯60.985.5-148YOLOv8 (P + F)✔✔⨯65.289.7+ 4.2123YOLOv8 (P + G)✔⨯✔66.492.3+ 6.8119YOLOv8 (F + G)⨯✔✔59.387.9-134YOLOv12 (P)✔⨯⨯68.693.8-104YOLOv8 (P + F+G)✔✔✔73.296.7+ 11.2103 Table 7Ablation study on Tianchi aluminum profile defect dataset.Model VariantSpatial (P)Frequency (F)Gradient (G)mAP@0.5:0.95 (%)mAP@0.5 (%)ΔmAP(%)FPS > 100YOLOv8 (P)✔⨯⨯60.985.5-148YOLOv8 (P + F)✔✔⨯65.289.7+ 4.2123YOLOv8 (P + G)✔⨯✔66.492.3+ 6.8119YOLOv8 (F + G)⨯✔✔59.387.9-134YOLOv12 (P)✔⨯⨯68.693.8-104YOLOv8 (P + F+G)✔✔✔73.296.7+ 11.2103 Ablation study on Tianchi aluminum profile defect dataset. The ablation results demonstrate the complementary nature of the three feature domains. Adding the frequency domain (P + F) yields a 4.2% absolute improvement in mAP@0.5 over the spatial-only YOLOv8 baseline, indicating that wavelet-based spectral features enhance the detection of low-contrast and texture-oriented defects. Incorporating the gradient domain (P + G) provides an larger gain of 6.8% absolute improvement in mAP@0.5 over the spatial-only YOLOv8 baseline, highlighting the effectiveness of edge and orientation-sensitive features in identifying elongated defects such as scratches and rolling marks. A notable observation is the relatively lower performance of the F + G configuration compared with models that include spatial features. Although frequency-domain features effectively capture texture regularities and periodic patterns, and gradient-domain features emphasize edge orientation and local intensity transitions, these representations lack explicit spatial structural information. As a result, the detector receives insufficient cues for precise object localization. Without spatial-domain features, the model suffers from degraded bounding-box regression and inaccurate object localization. In contrast, spatial features extracted from the backbone preserve the structural layout and positional context of surface defects. When spatial information is integrated with frequency or gradient representations (e.g., P + F or P + G), the detector benefits from both localization cues and complementary appearance descriptors, leading to significantly improved detection accuracy. The proposed Triple-Domain (P + F+G) achieves the highest overall detection performance, with 96.7% mAP@0.5 and 73.2% mAP@0.5:0.95, while maintaining real-time throughput at 103 FPS. These findings demonstrate that the proposed adaptive attention-based fusion strategy effectively leverages the complementary strengths of spatial, frequency, and gradient representations, producing a more robust feature space for industrial defect detection. To further validate the effectiveness of the proposed adaptive attention-based fusion module, the proposed fusion strategy was compared with several representative alternatives, including simple concatenation47, fixed-weight fusion31, SE-style channel attention50, and CBAM-style attention30. The results are presented in Table 8. Table 8Comparison of fusion strategies on the Tianchi dataset.Fusion StrategymAP@0.5 (%)mAP@0.5:0.95 (%)FPSFixed-weight fusion (α = β = γ = 1/3)3894.569.5112Simple concatenation4593.868.5118SE-style channel attention2595.070.3108CBAM-style attention3795.471.0105Proposed adaptive attention fusion96.773.2103 Table 8Comparison of fusion strategies on the Tianchi dataset.Fusion StrategymAP@0.5 (%)mAP@0.5:0.95 (%)FPSFixed-weight fusion (α = β = γ = 1/3)3894.569.5112Simple concatenation4593.868.5118SE-style channel attention2595.070.3108CBAM-style attention3795.471.0105Proposed adaptive attention fusion96.773.2103 Comparison of fusion strategies on the Tianchi dataset. To further examine the impact of input representation in the frequency and gradient domains, a comparative experiment was conducted between the proposed configuration, which uses RGB spatial input with grayscale-derived frequency and gradient representations, and a variant in which the frequency and gradient representations are derived from all RGB channels. As shown in Table 9, the proposed configuration improves detection performance from 95.5% to 96.7% mAP@0.5 and from 70.5% to 73.2% mAP@0.5:0.95, while reducing the number of parameters from 15.8 M to 14.9 M. Table 9Performance comparison between all-RGB inputs and the proposed configuration.InputPrecision (%)Recall (%)F1-score (%)mAP@0.5 (%)mAP@0.5:0.95 (%)Params (M)All RGB (P, F, G)94.994.094.495.570.515.8Proposed (RGB P; Grayscale F and G)96.794.595.296.773.214.9 Table 9Performance comparison between all-RGB inputs and the proposed configuration.InputPrecision (%)Recall (%)F1-score (%)mAP@0.5 (%)mAP@0.5:0.95 (%)Params (M)All RGB (P, F, G)94.994.094.495.570.515.8Proposed (RGB P; Grayscale F and G)96.794.595.296.773.214.9 Performance comparison between all-RGB inputs and the proposed configuration. A quantitative analysis of the average fusion weights produced by the Adaptive Triple-Domain Fusion Module was conducted for all nine defect categories across three detection scales (P3, P4, P5). The results are presented in Table 10. Table 10Average fusion weights per defect category and detection scale.Defect ClassScaleSpatialFrequencyGradientLongitudinal ScratchP30.340.21 0.45 P40.350.20 0.45 P50.380.22 0.40 Transverse ScratchP30.330.17 0.50 P40.360.19 0.45 P50.390.21 0.40 Rolling MarkP30.300.20 0.50 P40.330.22 0.45 P50.360.24 0.40 Non-ConductiveP30.28 0.52 0.20P40.30 0.52 0.18P50.32 0.50 0.18Oil StainP30.27 0.53 0.20P40.29 0.51 0.20P50.31 0.49 0.20OxidationP30.26 0.54 0.20P40.28 0.52 0.20P50.30 0.50 0.20CrackP30.350.20 0.45 P40.380.22 0.40 P50.410.24 0.35 PitP3 0.41 0.370.22P4 0.43 0.360.21P5 0.45 0.350.20Edge DamageP3 0.40 0.350.25P4 0.42 0.340.24P5 0.44 0.330.23 Table 10Average fusion weights per defect category and detection scale.Defect ClassScaleSpatialFrequencyGradientLongitudinal ScratchP30.340.21 0.45 P40.350.20 0.45 P50.380.22 0.40 Transverse ScratchP30.330.17 0.50 P40.360.19 0.45 P50.390.21 0.40 Rolling MarkP30.300.20 0.50 P40.330.22 0.45 P50.360.24 0.40 Non-ConductiveP30.28 0.52 0.20P40.30 0.52 0.18P50.32 0.50 0.18Oil StainP30.27 0.53 0.20P40.29 0.51 0.20P50.31 0.49 0.20OxidationP30.26 0.54 0.20P40.28 0.52 0.20P50.30 0.50 0.20CrackP30.350.20 0.45 P40.380.22 0.40 P50.410.24 0.35 PitP3 0.41 0.370.22P4 0.43 0.360.21P5 0.45 0.350.20Edge DamageP3 0.40 0.350.25P4 0.42 0.340.24P5 0.44 0.330.23 Average fusion weights per defect category and detection scale. Table 10 shows that oriented defects, including scratches, rolling marks, and cracks, are assigned higher gradient weights (0.35–0.50), whereas texture-dominated defects, including non-conductive defects, oil stains, and oxidation, are assigned higher frequency weights (0.49–0.54), and structural defects, including pits, edge damage, are assigned higher spatial weights (0.40–0.45). Performance comparison of different models To evaluate the proposed Triple-Domain YOLOv8 against existing approaches, a comprehensive comparison was conducted using the Tianchi Aluminum Profile Surface Defect Dataset. The evaluated methods include Lightweight YOLOv818, MS-SA Network27, MSFF Network31, Two-Stream Gradient CNN28, SFC-YOLOv839, and MCH-YOLOv1237. In addition to standard detection metrics (Precision, Recall, mAP@0.5, mAP@0.5:0.95), the comparison also reports model complexity (number of parameters and FLOPs) and training efficiency (time per epoch). The reported results of existing methods were derived from their original publications under the same consistent experimental protocol on the Tianchi dataset. The results are presented in Table 11. Table 11Performance comparison of different models.ModelPrecision (%)Recall (%)mAP@0.5 (%)mAP@0.5:0.95 (%)FPSParams (M)FLOPs (G)Training TimeLightweight YOLOv81891.488.688.663.21529.321.72.9MS-SA Network3492.890.191.166.811712.730.84.4MSFF Network3893.190.791.767.511113.433.14.8Two-Stream Gradient CNN35 (P + G)92.489.591.965.18218.641.36.2SFC-YOLOv8 (P + F)2694.291.693.769.110912.931.94.3MCH-YOLOv124495.192.894.870.39717.345.86.9Adaptive Triple-Domain YOLOv8 96.7 94.5 96.7 73.2 103 14.9 35.6 5.1 Table 11Performance comparison of different models.ModelPrecision (%)Recall (%)mAP@0.5 (%)mAP@0.5:0.95 (%)FPSParams (M)FLOPs (G)Training TimeLightweight YOLOv81891.488.688.663.21529.321.72.9MS-SA Network3492.890.191.166.811712.730.84.4MSFF Network3893.190.791.767.511113.433.14.8Two-Stream Gradient CNN35 (P + G)92.489.591.965.18218.641.36.2SFC-YOLOv8 (P + F)2694.291.693.769.110912.931.94.3MCH-YOLOv124495.192.894.870.39717.345.86.9Adaptive Triple-Domain YOLOv8 96.7 94.5 96.7 73.2 103 14.9 35.6 5.1 Performance comparison of different models. As shown in Table 11, the proposed Triple-Domain YOLOv8 achieves higher performance than the compared methods under comparable experimental settings on the Tianchi dataset. It obtains the highest overall detection performance, with 96.7% mAP@0.5 and 73.2% mAP@0.5:0.95, while maintaining real-time inference at 103 FPS. Compared to the strongest baseline, MCH-YOLOv12, the proposed model delivers absolute gains of + 1.9% in mAP@0.5 and + 2.9% in mAP@0.5:0.95, with fewer parameters (14.9 M vs. 17.3 M), and lower FLOPs (35.6 G vs. 45.8 G), demonstrating a favorable accuracy–speed trade-off. Despite incorporating three parallel feature domains and adaptive fusion, the model remains computationally efficient, requiring 14.9 M parameters and 35.6 G FLOPs while achieving 103 FPS, indicating that the multi-domain strategy enhances feature discriminability with manageable computational overhead. These results suggest that the proposed framework provides a strong accuracy-efficiency trade-off for robust, high-precision, real-time detection of aluminum profile surface defects compared with recent methods. Class-wise performance comparison To evaluate the defect detection capabilities of the proposed method, a detailed class-wise performance analysis was conducted among the compared models under identical experimental conditions. Table 12. Class-wise detection performance comparison (mAP@0.5) on the Tianchi dataset. Table 12Comparison of model performance for different types of defects.Defect TypeLightweight YOLOv8 [18]MS-SA [34]MSFF [38]Two-Stream Gradient CNN [35]SFC-YOLOv8 [26]MCH-YOLOv12 [44]Adaptive Triple-Domain YOLOv8Longitudinal Scratch88.790.991.492.894.195.0 97.4 Transverse Scratch87.990.290.892.193.694.5 96.8 Rolling Mark87.189.790.491.893.094.1 96.2 Non-Conductive90.592.893.392.494.295.4 97.3 Oil Stain91.393.593.992.994.995.8 97.9 Oxidation89.692.192.792.093.895.0 96.7 Crack85.288.689.191.092.593.6 95.7 Pit88.190.791.391.693.294.4 95.8 Edge Damage89.491.692.292.593.995.1 96.9 Mean mAP@0.588.691.191.791.993.794.8 96.7 Table 12Comparison of model performance for different types of defects.Defect TypeLightweight YOLOv8 [18]MS-SA [34]MSFF [38]Two-Stream Gradient CNN [35]SFC-YOLOv8 [26]MCH-YOLOv12 [44]Adaptive Triple-Domain YOLOv8Longitudinal Scratch88.790.991.492.894.195.0 97.4 Transverse Scratch87.990.290.892.193.694.5 96.8 Rolling Mark87.189.790.491.893.094.1 96.2 Non-Conductive90.592.893.392.494.295.4 97.3 Oil Stain91.393.593.992.994.995.8 97.9 Oxidation89.692.192.792.093.895.0 96.7 Crack85.288.689.191.092.593.6 95.7 Pit88.190.791.391.693.294.4 95.8 Edge Damage89.491.692.292.593.995.1 96.9 Mean mAP@0.588.691.191.791.993.794.8 96.7 Comparison of model performance for different types of defects. As illustrated in Table 12, the proposed Triple-Domain YOLOv8 consistently achieves the highest mAP@0.5 across every defect category. The most significant improvements achieved by the Triple-Domain YOLOv8 are observed for elongated and directional defects (Longitudinal Scratch, Transverse Scratch, Rolling Mark, and Crack) as well as texture-dominated and low-contrast anomalies (Non-Conductive, Oil Stain, and Oxidation), confirming the strengths of integrating gradient and frequency features with spatial features. Compared to MCH-YOLOv12, the proposed method yields an average gain of + 1.9% in mAP@0.5, while the improvement exceeds + 5.0% relative to the spatial-only baseline. These results underscore the proposed framework’s superior performance across a diverse spectrum of aluminum surface defect types, validating the effectiveness of explicitly and adaptively modeling spatial, frequency, and gradient information within a unified detection architecture. Although the proposed method achieves the highest accuracy in all categories, certain defects, particularly fine cracks, pits, and low-contrast oxidation regions, still exhibit minor localization or confidence errors. These failure cases are primarily caused by their extremely small size, weak boundary contrast, or visual similarity to the background texture. In some instances, environmental noise and uneven illumination further compromise the clarity of defect boundaries. These factors inherently challenge all detectors and explain the residual errors observed in our results. Nevertheless, the incorporation of gradient and frequency domain cues substantially reduces these errors compared with single-domain baselines, demonstrating the robustness of the proposed multi-domain design. Accuracy-speed trade-off analysis The proposed Triple-Domain YOLOv8 achieves the highest detection accuracy (96.7% mAP@0.5) with an inference speed of 103 FPS, demonstrating a favorable accuracy-speed trade-off compared to existing models. Figure 10 illustrates the trade-off between detection accuracy (mAP@0.5) and inference speed (FPS) among the evaluated models. Fig. 10Detection accuracy (mAP@0.5) versus inference speed (FPS) comparison. Detection accuracy (mAP@0.5) versus inference speed (FPS) comparison. Visual validation of defect detection To complement the quantitative results, representative visual examples are presented to further evaluate the proposed defect detection framework. Representative defect samples from three challenging scenarios are selected, including small defects (Scratch), complex textures (Non-Conductive), and low-contrast defects (Pit). To further support the complementarity of the three feature domains, the average fusion weights produced by the Adaptive Triple-Domain Fusion Module are analyzed for representative defect types at the P3 detection scale, as summarized in Table 13. The results indicate that different defects benefit from different feature domains. Table 13Average fusion weights for representative defect classes at P3 detection scale.Defect ClassSpatialFrequencyGradientScratch0.340.21 0.45 Non-Conductive0.28 0.52 0.20Pit 0.41 0.370.22 Table 13Average fusion weights for representative defect classes at P3 detection scale.Defect ClassSpatialFrequencyGradientScratch0.340.21 0.45 Non-Conductive0.28 0.52 0.20Pit 0.41 0.370.22 Average fusion weights for representative defect classes at P3 detection scale. Figure 11 provides a visual representation of the average fusion weights reported in Table 13, illustrating the contribution of each feature domain for representative defect types. The results indicate that the model adaptively emphasizes different domains according to defect characteristics, highlighting the complementary roles of spatial, frequency, and gradient features in improving detection performance. A comprehensive analysis of fusion weights for all nine defect categories across all three detection scales (P3, P4, P5) is provided in Table 10 in Sect. 4.7. Fig. 11Average fusion weights of spatial, frequency, and gradient features for representative defect classes at the P3 detection scale. Average fusion weights of spatial, frequency, and gradient features for representative defect classes at the P3 detection scale. Figure 12. Visual comparison of defect detection results under three scenarios: small defects (Scratch), complex textures (Non-Conductive), and low-contrast defects (Pit). Each column shows the raw image, ground truth, YOLOv8 predictions, and the results of the proposed method. Fig. 12Visual comparison of defect detection results under three challenging scenarios: small defects (Scratch), complex textures (Non-Conductive), and low-contrast defects (Pit). Visual comparison of defect detection results under three challenging scenarios: small defects (Scratch), complex textures (Non-Conductive), and low-contrast defects (Pit). Conclusion This study has presented an Adaptive Triple-Domain YOLOv8 framework for real-time surface defect detection in aluminum profiles. The proposed architecture jointly exploits spatial, frequency, and gradient domains information by integrating standard convolutional features with the Discrete Wavelet Transform (DWT) and multi-scale Gabor filters. This multi-domain representation enables the model to capture complementary characteristics of surface defects: spatial-domain features describe structures layouts, frequency-domain features highlight subtle texture irregularities, and gradient-domain features emphasize directional edges and patterns. An adaptive attention-based fusion module is employed to combine these heterogeneous features, helping the network distinguish diverse defect types under challenging industrial conditions such as illumination variation, reflections, and complex backgrounds. Experimental evaluations on the Tianchi Aluminum Profile Surface Defect Dataset indicate the effectiveness of the proposed approach. The model achieves 96.7% mAP@0.5 and 73.2% mAP@0.5:0.95, while maintaining real-time inference at 100 FPS. Ablation studies further confirm that each domain contributes to improved detection performance and that the adaptive fusion strategy plays an important role in balancing detection accuracy and computational efficiency. The proposed design achieves a favorable trade-off between detection accuracy and computational cost, maintaining real-time performance while significantly improving detection precision, which is essential for deployment in real-world industrial inspection systems. Despite these advantages, the current implementation uses grayscale inputs in the frequency and gradient branches, which may limit the exploitation of color cues for certain defects. Future work will explore color-aware wavelet and Gabor representations, learnable multi-scale fusion strategies, and the integration of additional sensing modalities such as polarization imaging. Another promising direction is channel-wise domain fusion, in which independent weights are assigned to each channel within each domain to enable more fine-grained feature reweighting. Overall, the proposed Adaptive Triple-Domain YOLOv8 provides an effective framework for aluminum surface inspection and offers a promising basis for extending multi-domain defect detection to other industrial materials. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Supplementary Material 1