# Automatic Optimization of Deep Learning Training through Feature-Aware-Based Dataset Splitting
## 3 Materials and Methods
### General Workflow  
The process of model development begins with a critical step, which is the division of the original dataset into distinct subsets for training-validation and testing. This process serves as the foundation upon which the subsequent stages of model refinement and evaluation rest. The workflow of this work (Figure 4) begins by partitioning the original raw data into the training-validation and testing subsets, at a rate of 80% and 20%, respectively. Then, the training-validation subset is subdivided once again into train and validation subsets. During the evaluation step, a set of commonly used metrics is employed to assess resulting models, namely, involving accuracy and intersection over union (IOU). These metrics characterization can be found below:  
* Accuracy is a fundamental metric in the field of machine learning, measures the proportion of correctly predicted instances out of the total number of instances. It is usually used to evaluate how well the model classified and predicted classes over a testing subset. More specifically, it provides an overall assessment of a model's correctness (Equation (1)). \[\text{Accuracy}=\frac{TP}{TP+TN+FP+FN}\] (1) where true positives (_TP_) and true negatives (_TN_) represent, respectively, the number of instances that were correctly classified as positive and negative by the model; in turn, false positives (_FP_) and false negatives (_FN_) correspond to the number of instances incorrectly classified as positive and negative, respectively.
* IOU is a spatial overlap metric commonly used in tasks involving object detection and segmentation. It quantifies the degree of overlap between the predicted regions and the ground truth regions. Specifically, IOU calculates the ratio of the intersection area between the predicted and actual regions to the union area of those regions. IOU allows the capture of the spatial alignment and precision of the model's output in relation to the true object regions. To compute it, the most prominent attention area of CNN's gradient-weighted class activation mapping (Grad-CAM) is used as a bounding box predictor (Equation (2)).  
\[\text{IoU}=\frac{OverlapArea}{UnionArea} \tag{2}\]  
where _OverlapArea_ and _UnionArea_ represent, respectively, the intersection and the union between ground-truth and the predicted bounding boxes of a given object of interest.  
Regarding the training process, the Xception architecture is employed using Adam with Nesterov momentum (Nadam), and stochastic gradient descendent (SGD) optimizers with an initial learning rate of \(1\times 10^{-3}\). To assure the consistency of the training conditions across all dataset splitting approaches, a set of hyperparameters is maintained across the experiments. This includes a batch size of 32, ensuring efficient training iterations; 100 training epochs; and an early stopping callback with a patience of 20 epochs. This former event monitor tracks validation accuracy and triggers in the absence of fluctuations greater than \(1\times 10^{-4}\) for more than 20 consecutive epochs, indicating model stagnation. Also, a dropout regularization with a weight of 0.2 was included to make the models less prone to overfitting.  
It is important to note that the hyperparameters used in the experiments were chosen based on previous work [1] and remained consistent across all training sessions. This seeks to ensure a fairer comparison and consistency in model training, by duly isolating and accommodating the main study object, i.e., the impact of varying splitting techniques.