# Automatic Optimization of Deep Learning Training through Feature-Aware-Based Dataset Splitting
## 3 Materials and Methods
### Imagery Used for the Empirical Assessment of the Proposed Dataset Splitting Methodology  
A couple of distinct groups of imagery involving differentiated contexts are considered to perform empirical experiments on the proposed feature-aware dataset splitting methodology. The first image group, described in [2], within the context of viticulture, is composed of 6 different varieties (Figure 1), summing up a total of 480 images. The varietiesinvolved in this image group are the following: _Touriga Nacional_, _Tinto Cao_, _Codega_, _Moscatel_, _Tinta Roriz_, and _Rabigato_. In terms of acquisition procedure, weekly between 4 May and 31 July 2017, one leaf was picked from the same two previously selected plants of each grapevine variety, put on top of a white sheet of paper (background), and photographed (in the field) without any artificial lighting, using a Canon EOS 600D, equipped with a 50 mm f/1.4 objective lens (Canon, Ota, Tokyo, Japan). For the sake of variability, data collected on cloudy days and in sunny late afternoons was also included. It is worth noting that leaf acquisition and labeling were supported by domain experts. Table 1 presents the distribution of examples per class, more specifically 80 images evenly assigned. The second image group regards the context of bridge defects. This collection was created by capturing photographs of various bridges using a handheld camera and a mobile phone, resulting in a set of images with a diverse range of sizes and resolutions. Afterward, each image was manually labeled using a tool called Labellmg [53] and attributed to one of the six groups representing defect types: _paint deterioration_, _plant_, _absence of joint cover plate_, _cracks_, _pavement crack_, and _peeling on concrete_ (Figure 2). In total, 2400 images were labeled. However, a pruning operation to remove unusable data had to be carried out, resulting in a final set of 1872 images. Civil engineers possessing technical expertise in the relevant domain both participated actively in the direct image acquisition process and provided support for the labeling procedures. The distribution of classes in this dataset is illustrated in Table 2. The \"pavement crack\" class is largest, with 461 images, while the \"peeling on concrete\" class is the smallest one, containing 101 images. This dataset showcases an uneven distribution of data among the classes. Having both balanced and unbalanced datasets allows a more realistic evaluation of the splitting techniques under comparison. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline Class name & _Codega_ & _Moscatel_ & _Rabigato_ & _[PERSON]_ & _[PERSON]_ & _Touriga Nacional_ \\ \hline
**Size** & & & & & 80 & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distribution of classes and their respective sizes within the grapevine leaves imagery. Figure 1: Raw data of grapevine leaves composed of 6 classes (phenotypes), acquired over a white background—also documented in previous work [2]. From left to right: _Touriga Nacional_, _[PERSON]_, _Codega_, _Moscatel_, _[PERSON]_, and _[PERSON]_.  
Complementary Imagery for Extended Assessments--Models Inference Consistency and Attention Map Analysis  
Two other grapevine and bridge defects external datasets were included in this study (Figure 3), envisaging an extended assessment that focuses on the following aspects: (a) the model prediction consistency over data that are characteristically different from the ones used for training; (b) CNNs attention maps-based metrics for a richer interpretation of the trained models. Within the vineyard context, another dataset of 12 grapevine varieties was considered, based on imagery captured in a natural background--_Codega_, _Malvasi  
Figure 3: External image sets DL models extended assessments: (a) features a set of images for grapevine variety identification through leaf analysis; (b) showcases examples related to the detection of bridge defects.