## 3 Results and Discussion of CNN Models Classification
### Numerical Experiments  
Figure 7 presents a flowchart illustrating the workflow for the numerical experiments conducted in this study. The process began with the acquisition of data, which included collecting images of drilled holes categorized into three classes: Green, Yellow, and Red. The next step was data preparation, where the dataset was organized and augmented to enhance model training.  
Three CNN models--VGG16, VGG19, and ResNet101--were then constructed and fine-tuned for the classification task. After model evaluation, the best-performing model, which in this study was VGG19, was selected for further analysis. Explainable AI (XAI) techniques, specifically Grad-CAM and LIME, were applied to this model to gain insights into its decision-making process.  
The insights gathered from these XAI techniques were then used to adjust and improve the input images or training process, after which the entire cycle was repeated if necessary. This iterative process ensures continuous model refinement and improved classification performance.  
Figure 7: Flowchart illustrating the workflow for the numerical experiments conducted in this study.  
In this section, we detail the numerical tests carried out to assess how well CNN models can classify drilled holes in melamine-faced chipboard. We applied a 5-fold cross-validation method (involving five different drills), dividing the dataset into five parts. Each part was alternately used as a test set, with the other four parts serving for training.  
We arranged the image data into five separate folders, each folder corresponding to distinct data collection dates. The folders included images classified into three categories: \"Green\", \"Yellow\", and \"Red\", indicating the state of the drilled holes.  
For cross-validation, we generated five folds. In every fold, a single subset was selected as the test set, and the rest were amalgamated to create the training set. This strategy guaranteed that each subset was utilized as a test set once, offering a thorough assessment of the model's effectiveness.  
For each fold, we performed the following steps:  
1. Data preparation--the images in the training set were loaded and labeled accordingly.
2. Model configuration--we used the pretrained CNN network, modifying its final layers to fit our classification task. The fully connected layer was adjusted to have three outputs corresponding to the three classes, and the final classification layer was added.
3. Training--the network was trained using stochastic gradient descent with momentum (SGDM) for 10 epochs. Training parameters such as the mini-batch size (32) and initial learning rate (\(1\times 10^{-4}\)) were optimized to achieve the best performance.
4. Evaluation--the trained model was evaluated on the test set for each fold. We recorded the accuracy and generated confusion matrices to analyze the classification performance.  
We have applied a 5-fold cross-validation approach, which involved splitting the dataset into training and test sets in such a way that each fold had data from one drill reserved for testing, while the remaining four drills' data were used for training. This division was suggested by industry experts to ensure the robustness and generalization of the models across different tools.  
Table 3 provides a summary of the data distribution in each of the 5 folds. Each fold includes a test set from one drill and a training set from the remaining four drills. The table presents the number of images in both the training and test sets for each fold.