Experimental setup
The Adaptive Dual-Attention Network for High-Shot Supervised Two-Stage Industrial Anomaly Detection was implemented in Python using PyTorch. The experiments were carried out on the VisA benchmark dataset, which was split according to the official 2-class high-shot supervised split. To prevent leakage in the model selection, the official training partition was additionally split into training and validation partitions, while the official non-training partition remained untouched as a holdout test set. Consequently, the used dataset included 5,191 training samples, 1,302 validation samples, and 4,328 test samples. The training set was used for optimization, the validation set was used solely for learning-rate scheduling, checkpoint selection, and early stopping, and the holdout test set was used only for final performance evaluation.
The proposed Adaptive Dual-Attention (ADA) block integrates features extracted by the DenseNet-121 backbone, initialized with pre-trained ImageNet weights, using Squeeze-and-Excitation (SE) and Efficient Channel Attention (ECA). The Ada feature representation is obtained via a global scalar fusion coefficient that balances the contributions of the SE and ECA feature representations. This coefficient is shared across input samples and is used by the hierarchical two-stage classification pipeline to first detect the product category and then classify each sample as either normal or anomalous.
The proposed architecture was optimized using the Adam optimizer with the initial learning rate of 1 x 10⁻4. Adaptive learning-rate scheduling was implemented using the ReduceLROnPlateau scheduler with a reduction factor of 0.5 and a patience of 2 epochs, while the validation macro F1-score was used as the monitoring criterion. The early stopping strategy was applied after four consecutive validations with no improvement in the validation macro F1-score, and the best-performing checkpoint was saved. The holdout test partition was not used for learning-rate scheduling, early stopping, checkpoint selection, and hyperparameter optimization.
The input images were resized to 224 x 224 pixels and normalized according to the ImageNet mean and standard deviation. During the training stage, random rotation of ±10°, horizontal flip, and color jitter data augmentations were used, while resizing and ImageNet normalization were applied to validation and test images. Weighted cross-entropy loss was used for optimization to handle class imbalance.
To address the VisA dataset task, the Stage-I classifier was optimized to recognize 12 object categories, while object-specific Stage-II classifiers were further trained to detect normal and anomalous samples for each category. During the inference phase, the predicted category from Stage I was used to route each sample to its corresponding Stage-II classifier. Final performance metrics were reported using the holdout test partition after applying all model selections on the validation partition. Experiments were carried out on a workstation with Windows 11 OS, Intel Core processor, and NVIDIA GeForce RTX 4050 Laptop GPU with 6 GB VRAM. More implementation details and the hyperparameters used are provided in Table 2.
Evaluation metrics
Several quantitative criteria are used to evaluate the classification performance of the suggested Adaptive Dual-Attention Networks for High-Shot Supervised Two-Stage Industrial Anomaly Detection algorithm. These measures capture several aspects of prediction performance, including label consistency, handling of imbalanced classes, accuracy, and class-wise discrimination. Accuracy, Precision, Recall, F1-score, Receiver Operating Characteristic-Area Under the Curve (ROC-AUC), Matthews Correlation Coefficient (MCC), and Cohen's Kappa are the evaluation measures. Additionally, Grad-CAM visualization is used to qualitatively analyze the model's decision-making process, and the Confusion Matrix is used to assess class-wise prediction performance. The mathematical formulation of the evaluation metrics is as follows:
Accuracy
The percentage of samples that are correctly classified out of all samples is called accuracy.
(17)
where
TP = True Positives
TN = True Negatives
FP = False Positives
FN = False Negatives
Precision
Precision is the ratio of the correctly identified positive samples to the total number of predicted positives.
(18)
Recall
The percentage of accurately detected positives among all actual positives is known as recall.
(19)
F1-score
The F1-Score uses the harmonic mean of Precision and Recall to assess categorization ability. When assessing classification performance, the F1-Score is particularly useful in class-imbalanced datasets.
(20)
An increased F1 score suggests a better classification performance.
ROC-AUC
Based on the ratio of True Positive Rate (TPR) to False Positive Rate (FPR), the ROC-AUC statistic assesses the classifier's capacity for discriminating.
(21)
(22)
A higher ROC-AUC value indicates that the suggested system can distinguish between distinct classes more effectively.
Matthews Correlation Coefficient (MCC)
Every value in the confusion matrix is taken into consideration by MCC.
(23)
Cohen's Kappa
After accounting for random agreement, Cohen's Kappa statistics evaluate the agreement between expected and actual classes.
(24)
where Po represents the observed agreement and Pe denotes the expected agreement by chance.
Quantitative results
This section presents the quantitative results obtained for the developed Adaptive Dual-Attention Network for High-Shot Supervised Two-Stage Industrial Anomaly Detection on the VisA benchmark dataset. The hierarchical framework was evaluated against three criteria: object classification, anomaly detection, and two-stage classification results.
Stage I object classification results
In the first stage of the proposed model, the primary aim is to detect object categories before anomaly detection. Using the discriminative features captured by the ImageNet-pretrained DenseNet-121 network and then improved by the newly developed Adaptive Dual Attention (ADA) block, the model correctly identified all 12 object categories in the VisA dataset.
The Stage I confusion matrix is presented in Supplementary Figure 2, and the quantitative data are shown in Table 3. The accuracy, precision, recall, f1-score, ROC-AUC, Matthews correlation coefficient (MCC), and Cohen's Kappa scores of the suggested model were all 100%. From these results, one can conclude that the categories of objects differ markedly in their shapes, textures, and structures and are thus highly distinguishable. Moreover, using ImageNet transfer makes the backbone network's job much easier, as it enables it to capture the semantic features of objects; therefore, recognizing them becomes much easier. Thus, the object prediction in Stage I is highly reliable.
Stage II anomaly detection results
The Stage II anomaly detection model's performance metrics are presented in Table 4 as macro averages, and the confusion matrix is shown in Figure 3 with class-based analysis. Across the twelve industrial object categories, the model achieved a mean accuracy of 96.26 ± 0.92% over three independent runs. The values reported below correspond to the representative run with seed 42, from which Figure 3 and Figure 5 were generated. Based on the confusion matrix, this run achieved 97.11% accuracy, 92.84% macro precision, 92.45% macro recall, and 92.64% macro F1-score. The ROC curve showed an AUC of 98.00%. The MCC and Cohen's kappa were both approximately 0.8529, indicating strong agreement between the ground-truth and predicted labels. The two coefficients were computed independently and agreed to four decimal places in this run, as confirmed by their divergence in the remaining reported runs.
Training performance analysis
Stage I training performance
The training curves in Supplementary Figure 3 show the training and validation accuracies and losses for the Stage I object classifier, respectively. During the early epochs, convergence occurs quickly, with training and validation accuracy reaching 100% and loss values dropping to nearly zero. This indicates strong consistency in the learning process, as the training and validation curves show little difference. Such behavior is natural, as the visual differences between the object classes in the VisA dataset can be easily learned by the model.
Stage II training performance
The training and validation accuracy curves, along with the loss curves, of the object-specific anomaly detection models at Stage II are shown in Figure 4A,B, averaged across the twelve object-specific classifiers. As the graphs show, training accuracy and loss improve consistently across epochs, whereas validation accuracy and loss fluctuate in later epochs rather than following a strictly monotonic trend. This fluctuation is why checkpoint selection is performed using the monitored validation F1-score rather than relying on the final epoch, and the use of the Adam optimizer, ReduceLROnPlateau scheduler, and early stopping helps limit overfitting despite it.
ROC curve analysis
The suggested hierarchical two-stage model's discriminatory power is evaluated using the ROC curves. ROC curve analysis is used to assess classification performance in the first stage of object classification, and for object-specific anomalies in the second stage.
Stage I ROC analysis
The ROC plot for the Stage I item classification model is shown in Supplementary Figure 4. It is positioned in the upper-left section of the ROC plot, demonstrating its strong capacity to distinguish among the twelve item categories employed. The ROC-AUC for this model was 100%, indicating that the DenseNet-121 backbone and the newly designed Adaptive Dual Attention (ADA) module learned discriminative representations effectively. The reason for this performance is the unique visual features of the objects in the VisA dataset and the effective use of ImageNet-based transfer learning.
Stage II ROC analysis
Figure 5 shows the ROC curve for the object-specific anomaly detection model at Stage II. The curve's proximity to the upper-left section demonstrates a strong capacity to distinguish between typical and abnormal occurrences. The developed model achieved an ROC-AUC score of 98.00% on seed 42, thereby establishing itself as an excellent tool for detecting industrial defects. The ROC-AUC score demonstrates the effectiveness of the proposed Adaptive Dual Attention network in developing defect-sensitive feature representations. From the analysis of the results provided in Table 5, one can observe that the proposed methodology achieves good performance across all object categories under consideration; however, the anomaly discrimination difficulty is varied among categories based on the visual characteristics of the objects and defect patterns.
Comparison with SOTA models
The performance of the introduced Adaptive Dual-Attention (ADA) Network for High-Shot Supervised Two-Stage Industrial Anomaly Detection was evaluated on the VisA benchmark dataset against representative methods in industrial anomaly detection, including EfficientAD + SegAD, DevNet, and ConvNeXt-Tiny. The evaluation was conducted using popular classification metrics, including accuracy, precision, recall, F1 score, and ROC-AUC, as shown in Table 6.
The results show that the proposed ADA Network performs best among the compared approaches on all five evaluation metrics. In seed 42, the proposed framework achieves an accuracy of 97.11%, while DevNet reaches 96.71%, EfficientAD + SegAD gets 96.43%, and ConvNeXt-Tiny attains 95.12%. Furthermore, the proposed approach reaches the highest precision, recall, and F1-score of 92.84%, 92.45%, and 92.64%, respectively. Moreover, the proposed framework achieves an ROC-AUC score of 98.00%, indicating strong discriminative power in distinguishing between normal and anomalous samples. Dense121 achieves 95.28% accuracy, which is slightly lower than the proposed model.
Such improvements can be explained using the proposed Adaptive Dual-Attention (ADA) module in conjunction with the DenseNet-121 architecture. The proposed framework exploits the complementarities between the feature representations of the SE and ECA mechanisms, thereby enhancing the discriminative power of representations for industrial images. In addition, the hierarchical two-stage approach helps separate object identification and object-specific anomaly detection, avoiding confusion when processing them simultaneously.
Compared with EfficientAD + SegAD, the proposed framework improves accuracy from 96.43% to 97.11%, precision from 90.21% to 92.84%, F1-score from 91.11% to 92.64%, and ROC-AUC from 97.62% to 98.00%. Compared to DevNet, the proposed framework improves accuracy from 96.71% to 97.11%, precision from 90.23% to 92.84%, F1-score from 91.02% to 92.64%, and ROC-AUC from 97.69% to 98.00%. The improvements in the performance metrics of the proposed framework against ConvNeXt-Tiny are even greater.
Ablation study
First, an ablation study was conducted to assess the efficiency of the proposed Adaptive Dual-Attention (ADA) module by comparing it with other well-known channel-attention methods: Squeeze-and-Excitation (SE) and Efficient Channel Attention (ECA). The experiment was conducted by using the same DenseNet-121 backbone, training strategy, hyperparameter tuning, and VisA dataset. Two single-stage configurations and two two-stage configurations were examined to more closely investigate the hierarchical nature of the introduced anomaly detection framework.
According to Table 7, the two-stage configurations outperformed their single-stage counterparts, thereby demonstrating the value of the object-specific hierarchical anomaly detection strategy. In the SE configuration, the two-stage architecture achieves 96.23% accuracy, compared to 84.34% for the single-stage approach. Similarly, the two-stage ECA configuration achieves 96.13% accuracy, compared to 83.53% for the single-stage model. This effect is also observable in the F1-score, which increases from 80.24% to 91.81% for SE and from 79.39% to 91.88% for ECA. These results suggests that separating object recognition from object-specific anomaly classification allows for better discrimination between normal and anomalous samples.
The suggested ADA two-stage configuration achieves the best overall performance: 97.11% accuracy, 92.84% precision, 92.45% recall, 92.64% F1-score, and 98.00% ROC-AUC. These results are better than the two-stage SE configuration: 96.23% of accuracy, 92.81% of precision, 91.88% of recall, 91.81% of F1-score, and 97.26% of ROC-AUC, and the two-stage ECA configuration: 96.13% of accuracy, 91.06% of precision, 91.74% of recall, 91.88% of F1-score, and 97.22% of ROC-AUC.
Moreover, the comparison demonstrates the advantage of the proposed ADA fusion in balancing precision and recall. While the two-stage SE model achieves a recall of 91.88% and a precision of 92.81%, the proposed ADA increases recall to 92.45% while maintaining slightly higher precision at 92.84%. The ECA model has a recall of 91.74%, but its precision of 91.06% is lower than that of the SE and ADA models. Thus, the learned fusion of the complementary SE and ECA representations improves the balance in anomaly classification.
The agreement-based metrics also confirm the effectiveness of the suggested configuration. The two-stage ADA model achieves the highest MCC (0.8529) and Cohen's Kappa (0.8529), compared to 0.8466 and 0.8413 for SE, and 0.8479 and 0.8476 for ECA, respectively. Thus, the improvement of agreement between the predicted and ground-truth anomaly labels is observed for the suggested framework.
In summary, the ablation results confirm two complementary contributions. First, the comparison of the single-stage and two-stage configurations confirms the value of the hierarchical object-specific anomaly detection strategy. Second, among the two-stage configurations, ADA consistently delivers the highest overall performance compared with the individual SE and ECA attention mechanisms. Thus, the results confirm the effectiveness of the proposed ADA approach, which combines the complementary feature-recalibration characteristics of SE and ECA via a learned scalar fusion mechanism within the two-stage industrial anomaly detection framework.
Grad-CAM visualization
The obtained Grad-CAM visualizations for the proposed framework are shown in Figure 6. These visualizations provide qualitative interpretability of the image regions that most influenced the model's prediction, rather than quantitative defect localization, since no localization metric (e.g., AUROC, PRO, IoU, or pointing-game accuracy) was computed. As can be seen, the produced activation maps tend to concentrate on the defective parts of the industrial objects with comparatively less emphasis on background regions. In normal samples, the activation map is distributed around the characteristic object structures, excluding irrelevant background, whereas in anomalous cases, the highlighted region visually overlaps with the defect area.
By combining the local channel-wise attention computed by the ECA block with the global context information provided by the SE branch, the proposed Adaptive Dual-Attention (ADA) block enhances the feature representation used for prediction. The resulting Grad-CAM visualizations qualitatively suggest that the network attends to regions associated with contaminations, cracks, scratches, and structural distortions, though this observation is based on visual inspection rather than a quantitative localization metric. The suggested framework provides both predictive performance on the evaluated benchmark and qualitative visual explanations for its predictions, which can support the interpretability of automated industrial inspection decisions.
Statistical analysis
To assess the robustness and consistency of the proposed Adaptive Dual-Attention Network (ADA-Net), the Stage-II anomaly detection experiment was conducted independently with three predefined random seeds: 42, 123, and 2024. The same training, validation, and held-out test partitions were maintained across all three experimental runs to ensure a consistent evaluation protocol. In each run, the proposed ADA-Net configuration was trained independently using the corresponding random seed. The performance was evaluated using accuracy, precision, recall, F1 Score, ROC AUC, Matthews Correlation Coefficient (MCC), and Cohen's Kappa.
The results obtained from the three independent runs were summarized using the mean and standard deviation (SD). The mean represents the average performance across the three runs, whereas the standard deviation indicates the variability associated with stochastic training effects. The proposed framework achieved an average accuracy of 96.26 ± 0.92%, precision of 91.86 ± 0.96%, recall of 91.34 ± 0.99%, and F1-score of 91.65 ± 0.90%. The average ROC-AUC was 97.55 ± 0.56%, demonstrating strong discrimination between normal and anomalous samples across the three experimental runs. The obtained MCC was 0.8453 ± 0.0070, and Cohen's Kappa was 0.8443 ± 0.0075. The results from the three independent runs are summarized as mean ± standard deviation in Table 8.
The relatively small standard deviations across the three seeds indicate that the proposed framework maintains consistent performance under different stochastic training conditions. In particular, the standard deviations of 0.0070 for MCC and 0.0075 for Cohen's Kappa indicate low variability in agreement-based performance across the three runs.
The three-seed evaluation demonstrated consistent Stage-II anomaly detection performance for ADA-Net, with an average F1-score of 91.65 ± 0.90% and ROC-AUC of 97.55 ± 0.56% across seeds 42, 123, and 2024. Because corresponding matched-seed results were not obtained for the SE and ECA configurations, the statistical significance of the differences between these models was not assessed.
Data Availability:
The data used in this study were obtained from publicly available repositories. The Amazon Visual Anomaly (VisA) dataset can be accessed through the Amazon Science Spot-Diff repository (https://github.com/amazon-science/spot-diff) and the corresponding AWS S3 resource (arn:aws:s3:::amazon-visual-anomaly/VisA_20220922.tar). The dataset is available under the Creative Commons Attribution 4.0 International (CC BY 4.0) license. The data related to this study are also available on Zenodo at https://doi.org/10.5281/zenodo.22008252.

Figure 1. Workflow of the proposed industrial anomaly detection framework. Schematic overview of the workflow, including dataset preparation, image preprocessing and data augmentation, feature extraction using the pretrained DenseNet-121 backbone, Adaptive Dual-Attention feature refinement, Stage I object classification, and Stage II object-specific anomaly detection. Please click here to view a larger version of this figure.

Figure 2. Hierarchical two-stage classification framework. The input image is processed using DenseNet-121 with Adaptive Dual-Attention feature extraction. Stage I predicts one of the 12 object categories, and the predicted object category routes the image to the corresponding Stage II binary classifier for classification as normal (0) or anomalous (1). Please click here to view a larger version of this figure.

Figure 3. Overall confusion matrix for Stage II anomaly detection. Confusion matrix showing the classification of normal and anomalous samples by the object-specific Stage II anomaly detection framework, with true labels represented by rows and predicted labels represented by columns. Please click here to view a larger version of this figure.

Figure 4. Training performance of the Stage II anomaly detection models. (A) Training and validation accuracy across six epochs. (B) Training and validation loss across six epochs. The curves represent the overall training behavior of the object-specific Stage II classifiers. Please click here to view a larger version of this figure.

Figure 5. Receiver operating characteristic curve for Stage II anomaly detection. Overall receiver operating characteristic (ROC) curve showing the true-positive rate against the false-positive rate for Stage II classification of normal and anomalous samples; the displayed area under the curve (AUC) is 0.980. Please click here to view a larger version of this figure.

Figure 6. Grad-CAM visualization of Stage II anomaly detection. Representative normal and anomalous samples from selected VisA object categories are shown alongside their corresponding Gradient-weighted Class Activation Mapping (Grad-CAM) heatmaps, illustrating the image regions that contribute to the model's predictions. Please click here to view a larger version of this figure.
Supplementary Figure 1. Representative images from the VisA benchmark dataset. Representative samples illustrate the visual characteristics of the object categories used to train and evaluate the proposed anomaly detection framework. Please click here to download this file.
Supplementary Figure 2. Confusion matrix for Stage I object classification. Confusion matrix showing true and predicted labels for the 12 VisA object categories in the Stage I classifier. Please click here to download this file.
Supplementary Figure 3. Training performance of the Stage I object classification model. (A) Training and validation accuracy across five epochs. (B) Training and validation loss across five epochs, showing convergence of the Stage I object classifier. Please click here to download this file.
Supplementary Figure 4. Receiver operating characteristic curves for Stage I object classification. Class-wise receiver operating characteristic (ROC) curves for the 12 VisA object categories, with an area under the curve (AUC) of 1.000 for each category. Please click here to download this file.
| Operation | Training | Testing |
| RGB Conversion | Used | Used |
| Resize (224 × 224) | Used | Used |
| Random Horizontal Flip | Used | Not Used |
| Random Rotation (±10°) | Used | Not Used |
| Color Jitter | Used | Not Used |
| Tensor Conversion | Used | Used |
| ImageNet Normalization | Used | Used |
Table 1: Image preprocessing and data augmentation techniques used in the study. The preprocessing operations applied to the training and testing datasets are summarized, including image resizing, augmentation, tensor conversion, and ImageNet normalization.
| Parameter | Value |
| Programming Language | Python |
| Deep Learning Framework | PyTorch |
| Operating System | Windows 11 |
| GPU | NVIDIA GeForce RTX 4050 Laptop GPU (6 GB) |
| Backbone Network | DenseNet-121 (ImageNet Pretrained) |
| Input Image Size | 224 × 224 |
| Optimizer | Adam |
| Learning Rate Scheduler | ReduceLROnPlateau |
| Loss Function | Weighted Cross-Entropy Loss |
| Batch Size | 64 |
| Number of Epochs | 15 |
| Early Stopping | Enabled |
| Data Augmentation | Rotation (±10°), Horizontal Flip, Color Jitter |
| Evaluation Dataset | VisA (Official High-Shot Supervised Split) |
Table 2: Experimental setup and hyperparameter settings. The software environment, hardware configuration, model architecture, optimization settings, training parameters, and evaluation dataset used to develop the proposed ADA Network are summarized.
| Metric | Value (%) |
| Accuracy | 100 |
| Precision | 100 |
| Recall | 100 |
| F1-score | 100 |
| ROC-AUC | 100 |
| MCC | 1 |
| Cohen's Kappa | 1 |
Table 3: Performance of the proposed Stage I object classification model on the VisA benchmark dataset. Overall classification performance is reported using accuracy, precision, recall, F1-score, ROC-AUC, Matthews correlation coefficient (MCC), and Cohen's kappa.
| Metric | Value |
| Accuracy | 97.11% |
| Precision | 92.84% |
| Recall | 92.45% |
| F1-score | 92.64% |
| ROC-AUC | 98.00% |
| MCC | 0.8529 |
| Cohen's Kappa | 0.8529 |
Table 4: Performance of the proposed Stage II object-specific anomaly detection model. Overall anomaly classification performance is reported using accuracy, precision, recall, F1-score, ROC-AUC, MCC, and Cohen's kappa.
| Object | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | ROC-AUC (%) | MCC | Kappa |
| Candle | 98.2 | 99 | 90 | 93.9 | 99.8 | 0.886 | 0.879 |
| Capsules | 90.4 | 81.4 | 76.7 | 78.7 | 89.6 | 0.579 | 0.576 |
| Cashew | 93.8 | 87 | 93.2 | 89.7 | 99.3 | 0.8 | 0.794 |
| Chewinggum | 97.1 | 96.1 | 93.3 | 94.6 | 98.8 | 0.893 | 0.892 |
| Fryum | 98.3 | 99 | 95 | 96.9 | 99.4 | 0.939 | 0.938 |
| Macaroni1 | 98.4 | 97.8 | 92.4 | 94.9 | 99.8 | 0.9 | 0.898 |
| Macaroni2 | 95.5 | 95.5 | 76.1 | 82.6 | 94.5 | 0.689 | 0.655 |
| PCB1 | 97.5 | 94.7 | 89.6 | 92 | 99.6 | 0.842 | 0.84 |
| PCB2 | 97.5 | 97.2 | 87.4 | 91.6 | 98.1 | 0.84 | 0.832 |
| PCB3 | 95.7 | 85.4 | 90.9 | 87.9 | 98.4 | 0.761 | 0.758 |
| PCB4 | 98.9 | 97.1 | 96 | 96.5 | 99.9 | 0.931 | 0.93 |
| Pipe Fryum | 98.8 | 99.3 | 96.3 | 97.7 | 99.6 | 0.955 | 0.954 |
Table 5: Category-wise performance of the proposed Stage II object-specific anomaly detection model. Performance across the 12 VisA object categories is reported using accuracy, precision, recall, F1-score, ROC-AUC, MCC, and Cohen's kappa.
| Method | Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | ROC-AUC (%) |
| EfficientAD + SegAD | VisA | 96.43 | 90.21 | 92.14 | 91.11 | 97.62 |
| DevNet | VisA | 96.71 | 90.23 | 92.17 | 91.02 | 97.69 |
| ConvNeXt-Tiny | VisA | 95.12 | 89.31 | 90.12 | 89.13 | 96.53 |
| Proposed ADA Network | VisA | 97.11 | 92.84 | 92.45 | 92.64 | 98.00 |
Table 6: Comparison of the proposed ADA Network with representative anomaly detection approaches. Performance on the VisA dataset is compared using accuracy, precision, recall, F1-score, and ROC-AUC.
| Attention Module | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | ROC-AUC (%) | MCC | Cohen's Kappa |
| DenseNet 121+SE ( Two Stage) | 96.23 | 92.81 | 91.88 | 91.81 | 97.26 | 0.8466 | 0.8413 |
| Densenet 121+SE (Single Stage) | 84.34 | 81.38 | 80.43 | 80.24 | 90.32 | 0.7936 | 0.7849 |
| Densenet 121+ECA ( Two Stage) | 96.13 | 91.06 | 91.74 | 91.88 | 97.22 | 0.8479 | 0.8476 |
| ECA (Single Stage) | 83.53 | 80.93 | 79.24 | 79.39 | 90.01 | 0.7753 | 0.7794 |
| Densenet 121+ADA (Proposed-multistage) | 97.11 | 92.84 | 92.45 | 92.64 | 98 | 0.8529 | 0.8529 |
Table 7: Ablation analysis of the attention mechanisms and classification strategies. Single-stage and two-stage configurations employing Squeeze-and-Excitation (SE), Efficient Channel Attention (ECA), and the proposed Adaptive Dual-Attention (ADA) approach are compared based on classification performance metrics.
| Metric | Seed 42 | Seed 123 | Seed 2024 | Mean ± SD |
| Accuracy (%) | 97.11 | 96.39 | 95.29 | 96.26 ± 0.92 |
| Precision (%) | 92.84 | 91.82 | 90.93 | 91.86 ± 0.96 |
| Recall (%) | 92.45 | 91.01 | 90.56 | 91.34 ± 0.99 |
| F1-score (%) | 92.64 | 91.44 | 90.87 | 91.65 ± 0.90 |
| ROC-AUC (%) | 98 | 97.72 | 96.92 | 97.55 ± 0.56 |
| MCC | 0.8529 | 0.8439 | 0.8392 | 0.8453 ± 0.0070 |
| Cohen's Kappa | 0.8529 | 0.8407 | 0.8392 | 0.8443 ± 0.0075 |
Table 8: Three-seed statistical performance of the proposed ADA Network. Performance across random seeds 42, 123, and 2024 is reported together with the mean ± standard deviation for each evaluation metric.
Supplementary Table 1. Comparison of recent industrial defect and anomaly detection methods. Representative published approaches are compared based on their methodologies, main contributions, strengths, and limitations relative to the proposed ADA Network. Please click here to download this file.
Supplementary Table 2. Distribution of images across the VisA object categories. The number of images in each of the 12 object categories and the total number of images in the VisA dataset are reported. Please click here to download this file.
Supplementary Table 3. Overview of the VisA benchmark dataset used in this study. The dataset composition, object categories, class definitions, label encoding, training protocol, image type, and classification task are summarized. Please click here to download this file.