# A New Defect Diagnosis Method for Wire Rope Based on CNN-Transformer and Transfer Learning
## 4 Case Studies
### Experiments
#### 4.4.1 Comparison Experiments
This phenomenon can be attributed to the reasonable adjustment of data distribution, even if the small target domain data was used. For example, task A\(\rightarrow\)D obtained a 98.96% detection accuracy after the use of transfer architecture. Additionally, the network weights were changed and became more suitable for the defect diagnosis performed in the target domain. The worst result was obtained by ELM, which is an unsupervised learning method with an average accuracy of only 86.00%. Specifically, DCNNT and DCNNT-5% achieved higher accuracy values than all the general classification methods. However, those SOTA algorithms also obtained acceptable results, such as Transformer1D, with 99.52% accuracy obtained in task D\(\rightarrow\)B, while the proposed DCNNT could balance detection accuracy, forward latency, and model size. Compared with the average accuracy (Avg) results presented in Tables 7 and 8, the results of each \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **A** & **B** & **C** & **D** & **Avg** \\ \hline ELM & 85.53 & 92.14 & 89.16 & 86.87 & 88.43 \\ KNN & 87.77 & 97.81 & 92.48 & 92.23 & 92.57 \\ BP & 88.81 & 97.17 & 96.57 & 96.23 & 94.69 \\ SVM & 90.36 & 98.83 & 97.94 & 98.75 & 96.47 \\ CWTCNN & 94.29 & 99.54 & 98.43 & 99.45 & 97.93 \\ Transformer1D & 95.96 & 99.68 & 99.25 & 99.85 & 98.68 \\ ResNet & 99.37 & 99.84 & 98.51 & 99.13 & 99.21 \\ DCNNT & 99.60 & 99.92 & 99.55 & 99.57 & 99.66 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Diagnosis accuracy (%) of different groups under the same working conditions. Figure 11: Performance comparison of different methods under the same working conditions. A, B, C, and D represent the different groups, while Avg denotes the average accuracy values of the different methods. algorithm present performance discrepancies, such as SVM with 96.47% accuracy in the same condition and 94.70% in the cross-domain tasks. Although this discrepancy was caused by the different test methods used, the trend of detection accuracy was consistent. A comprehensive evaluation considering different aspects is necessary for understanding the performance of the proposed methods. As shown in Table 9, Params and FLOPs denote the number of network parameters and computational complexities. Latency denotes forward inference latency with batch size one. CPU was used to test the latency instead of GPU, considering the economics of real-world applications. It can be observed that DCNNT obtained lower FLOPs and latency values: 1.388 G and 36.49 ms. This improvement can be ascribed to the operation of feature extraction and data transformation using the CNN prior to the self-attention method in the transformer. As described in Figure 8, the \(10\times 10\) image changed to \(4\times 4\). Consequently, the input sequence of the transformer was changed to 16 instead of 100. However, Transformer1D had a high computational cost and latency result because the original LMA signal with 100 points was set as the input; more self-attention operations have to be processed during forward inference and gradient update stages. Figure 12: Detection accuracy using different methods under cross-domain conditions. A\(\rightarrow\)B denotes a transfer task that uses samples obtained from source domain A, then verifies the performance with samples obtained from target domain B. Other tasks can be conducted through the same operation. Avg is the average accuracy of all involved methods.