# Simplified Machine Learning Model as an Intelligent Support for Safe Urban Cycling
## 3 Materials and Methods
### Dataset Overview  
In the area of one-shot learning, much of the research evaluating models for image categorization commonly uses the MiniImageNet [23] and CIFAR-100 [32] datasets. For this reason, we used both datasets in the experimental phase, which allowed us to compare them with other state-of-the-art methods that have also used them. Furthermore, we also added the CUB-200-2011 (Caltech-UCSD Birds-200-2011) dataset [33], which has recently been the dataset for comparing few-shot learning tasks, which is also the most used dataset for fine-grained visual categorization tasks. We also incorporated the DroNet dataset [34] to establish a comparison with a proposed autonomous drone driving approach for obstacle avoidance and make our evaluation and comparison more comprehensive. As a common practice in the area of machine learning, each dataset was divided into three subsets for one-shot learning: the training set (\(T_{s}\)), the validation set (\(V_{s}\)), and the search/query set (\(Q_{s}\)). \(T_{s}\) is a disjoint set of the sets \(Q_{s}\) and \(V_{s}\), but \(V_{s}\) and \(Q_{s}\) belong to the same category or class. Suppose there are a number \(i\) of categories in the training set, a number \(j\) of categories in the validation set, and a number \(k\) of categories in the search set. The set of category labels in \(T_{s}\), \(V_{s}\), and \(Q_{s}\) would then be \(C_{i}\), \(C_{j}\), and \(C_{k}\), respectively. Therefore, the label pairs for the images in the training set would be set by the following Equation (8):  
\[T_{s}=\big{\{}\big{(}x_{i},x_{j}\big{)},A\big{(}x_{i},x_{j}\big{)}\big{\}}\forall i,j=1..n \tag{8}\]  
for which \((x_{i},x_{j})\) are the image pairs in the training set and \(A(x_{i},x_{j})\) will be the affinity score of the image pair. Therefore, if \(x_{i}\) and \(x_{j}\) are equal, then the score will have a value of 1 and otherwise it will have a value of 0. It is set to \(n\) as the number of training samples or examples. Continuing with the label specification, Equation (9) names the image label pairs in the validation set as follows:  
\[V_{s}=\{(x_{k},x_{l}),A(x_{k},x_{l})\}\forall k,l=1..m \tag{9}\]  
for which \((x_{k},x_{l})\) are the image pairs in the validation set and \(A(x_{k},x_{l})\) is the affinity score of the image pair. Therefore, if \(x_{k}\) and \(x_{l}\) are equal, then the score will take a value of 1 and otherwise it will have a value of 0. \(m\) is the number of samples or examples for validation. Finally, the images that form the query set are specified in the following Equation (10):  
\[Q_{s}=\{x_{k}\}\forall k=1..n \tag{10}\]  
for which \(x_{k}\) are image samples from categories in the validation set. The final objective sought in this learning is to classify samples in the search/query set given some examples in the validation set meeting the following restrictions: \(C_{i}\
otin C_{j}\); \(T_{s}\cap V_{s}=\emptyset\); \(T_{s}\cap Q_{s}=\emptyset\); and \(Q_{s}\in V_{s}\). Therefore, the categories in the training versus validation set are disjoint, but those classes in the validation and query set are intersecting sets. The segmentation of the datasets used for the experimental phase of this study are briefly presented below:  
* The MiniImageNet dataset, as stated by [PERSON] et al. [23], contains 100 classes chosen randomly from the original ImageNet dataset, and each of those classes is itself composed of 600 images. The dataset was divided following what was presented in [31; 35; 36; 37], into 64, 16, and 20 training, validation, and test classes, respectively. The main reason for using this dataset is its complexity and its repeated use to test many other one-shot learning tasks. * The CIFAR-100 dataset, as stated in [32], contains 100 classes with 600 images each. The dataset was divided as suggested in [23; 35; 36; 38] into 64, 16, and 20 training, validation, and test classes, respectively. This division is in line with other research that evaluated one-shot learning models with this dataset.