## 3 Results
The best results while using the ResNet152 neural network were achieved using 32 batch size and 0.01 learning speed for stain and background class, 32 batch size and 0.1 learning speed for core class, 64 batch size and 0.1 learning speed for scratch class, and 128 batch size and 0.2 learning speed for branch class. Using an augmented dataset, the total accuracy of the method for finding defects in all classes increased from 60.5% to 68.3%. The accuracy of the quality grade increased from 67.7% to 69.3%. The augmentation of the dataset with synthetic data had the greatest impact on the accuracy of the core defect identification, which increased from 45.8% to 68.0%. The lowest impact was on branch type defects, the accuracy of which decreased from 82.8% to 79.7%. For transfer learning, each of the four models was pretrained 16 times using different combinations of batch size and learning speed parameters. The confusion matrices for all four transfer learning models are summarized in Figure 17.  
For AlexNet, most misclassifications occur between the branch and stain classes (14.5%). For VGG16, most misclassifications occur between the stain and scratch classes (14.5%). For BNInception, most misclassifications occur between the stain and core classes (12.9%). For ResNet152, most misclassifications occur between the stain and branch classes (12.9%). By training an additional classifier using transfer learning, the highest accuracy was achieved by the ResNet152 model-based neural network, which reached 80.6% accuracy for classification, but  
Figure 17: Confusion matrices of classification results while using (**a**) AlexNet; (**b**) VGG16; (**c**) BNInception; (**d**) ResNet152. was the slowest, as one image was processed in 48.01 ms. The fastest was the AlexNet model-trained method, which reached 80.0% accuracy for classification and processed one image in 6.76 ms, which is 7.1 times faster than the ResNet152 method. By combining all the defect classes into one type and training the faster R-CNN method, 96.10% accuracy in finding the surface defects was achieved. A comparison of neural network training speed and classification accuracy for the best neural network models is given in Table 3. The average accuracy value and its 95% confidence intervals were calculated by applying a standard 10-fold cross-validation procedure. The highest overall accuracy of 80.6% was achieved using the ResNet152 pre-trained model. The AlexNet model achieved an average accuracy of 80.2%. The class of branches was best classified using the BNInception pretrained model, which achieved 91.9% accuracy in branch classification. The scratches class was also best identified using the BNInception pretrained model, reaching an accuracy of 86.5%. The best classification accuracy was achieved with the background class that the ResNet152-model-trained model classified with an accuracy of 94.6%. The core defect class was best classified by the ResNet152 model, which reached 89.6% accuracy. Finally, in Table 4 we summarize the performance of neural networks using precision, recall, and f-score metrics. Although all the analyzed models perform similarly, the best results are obtained by the ResNet152 neural network model.