## 2 Methodology
### Comparator  
The traditional image feature extraction method is mainly based on spatial domain [6] or frequency domain transformation [7; 11] and artificially designed targeted feature descriptors. Many CTs with different textured templates include dark gray, light gray, gold-plated lines, and white, etc. At the same time, each texture template will be randomly cut into different textures according to the production size specifications. Therefore, the robustness of artificially designed feature operators is very poor, and it is almost challenging to adapt to various texture detection environments. In contrast, the automatic feature extraction method based on DCNN has been proven to have good results in complex and changeable situations [19; 20]. VGG16 [21] is the most representative network structure in DCNN, and it has achieved good results in characterizing abstract features in a complex background. In order to balance the calculation efficiency and accuracy, this paper adopts the improved VGG16 structure to extract the features of images for CT, as shown in Figure 2. The five convolutional pooling modules in the original VGG16 structure are retained, and the last three FC layers and soft-max layer are removed and replaced with FC1-25088 and FC2-1024. Considering the cost of model training time and feature extraction capabilities, this paper uses the pre-trained model weights based on the ImageNet-1k data set without retraining the modified VGG16 network. The image of CT is scale-transformed to a resolution of 224 \(\times\) 224 and sent to the modified VGG16 network to obtain a 1024-dimensional feature vector. When feature vectors of the negative sample set and the image to be detected are obtained, the problem of retrieving the negative sample with the most similar texture to the detection image is transformed into two feature vector distance measures. Commonly, distance metrics include Euclidean distance, Mahalanobis distance, Bach distance, cosine distance, and Hamming distance. Considering the comparison based on multi-dimensional feature vectors, the angle between the vectors is a good representation of the difference between them. At the same time, it is necessary to ensure the invariance of spatial translation, so this paper adopts the Pearson correlation distance to measure. Figure 2: Schematic diagram of a modified VGG16 network structure. Suppose that the images to be detected and the negative sample set are feature extraction and the vectors obtained are \(V_{\text{det}}(\beta_{i})\) and \(V^{j}_{re}(\alpha_{i})\), respectively, then the Pearson correlation coefficient between the two can be expressed as [22]:  
\[Corr^{j=1,\cdots,k}\Big{(}V^{j}_{re}(\alpha_{i}),V_{\text{det}}(\beta_{i})\Big{)} =\frac{\sum\limits_{i=1}^{n}\Big{(}V^{j}_{re}(\alpha_{i})-\overline{V}^{j}_{re }\Big{)}*\sum\limits_{i=1}^{n}\big{(}V_{\text{det}}(\beta_{i})-\overline{V}_{ \text{det}}\big{)}}{\sqrt{\sum\limits_{i=1}^{n}\big{(}V^{j}_{re}(\alpha_{i})- \overline{V}^{j}_{re}\big{)}^{2}}*\sqrt{\sum\limits_{i=1}^{n}\big{(}V_{\text{ det}}(\beta_{i})-\overline{V}_{\text{det}}\big{)}^{2}}} \tag{1}\]  
where \(n\) represents the dimension of the feature vector, \(k\) represents the number of negative sample sets, \(\overline{V}^{j}_{re}\) and \(\overline{V}_{\text{det}}\), respectively, represent the mean value of the feature vector of the reference image and the image to be detected. \[\overline{V}^{j}_{re}=\frac{1}{n}\sum\limits_{i=1}^{n}\alpha_{i}\]  
\[\overline{V}_{\text{det}}=\frac{1}{n}\sum\limits_{i=1}^{n}\beta_{i}\]  
From Equation (1), the distance between vectors can be obtained as:  
\[Dis^{j=1,\cdots,k}\Big{(}V^{j}_{re}(\alpha_{i}),V_{\text{det}}(\beta_{i}) \Big{)}=1-Corr^{j=1,\cdots,k}\Big{(}V^{j}_{re}(\alpha_{i}),V_{\text{det}}( \beta_{i})\Big{)} \tag{2}\]  
Obviously: \(Dis\in[0,2]\), and the smaller the distance between vectors, the higher the similarity; the greater the distance values, the lower the similarity.