# Bag-of-Visual-Words for Cattle Identification from Muzzle Print Images
## 4 Experimental Results
### Bag-of-Visual-Words with SURF Features  
The empirical work starts by checking the performance of the BoVW using the SURF features. In this case, the SURF approach was used for both feature detection and feature description operations. To check the BoVW performance under several training conditions, four scenarios involving 30%, 45%, 60% and 75% of the whole database were used as training input. The rest of the database in every scenario was used for testing and validation purposes. A linear kernel support vector machine was used in the last classification stage. To avoid any bias in the results, the database was randomly partitioned in each scenario. The histogram of visual word occurrences was considered, and the total number of visual words was set to 500 words.  
Figure 3: A sample from the nonstandard muzzle prints database of 105 images in total. The sample shows different augmentation parameters, such as image rotation, image blurring and image distortion.  
Figure 2: Outline of the main components of the bag-of-visual-words (BoVW)-based cattle identification system. The input muzzle print image database, feature extraction, feature clustering, bag-of-visual-words histograms and classification steps are highlighted as the main identification system components.  
The identification accuracy and the processing time were measured in each scenario and are recorded in Table 1. It is apparent that the identification accuracy and processing are proportional to the size of the training dataset. The maximum achieved accuracy is 93% using 75% (75 images of the 105 total images) of the data as the training dataset. However, the identification accuracy is acceptable and the situation has emerged due to the high similarity between the muzzle print images and hence between the visual words in the whole database.  
The confusion matrices confirm the obtained identification accuracies. The confusion matrices are shown in Figure 4. The figure is aligned with the accuracies in Table 1, where yellow represents the highest score.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Training (\%)**} & \multicolumn{2}{c}{**Configuration Parameters**} & \multicolumn{2}{c}{**BoVW Performance Metrics**} \\ \cline{2-5}  & **No. of Images** & **No. of Features (Average)** & **Accuracy (\%)** & **Time (s)** \\ \hline
30\% & 30 & 7600 & 75 & 27.7 \\
45\% & 45 & 7600 & 83 & 32.6 \\
60\% & 60 & 7600 & 91 & 42.5 \\
75\% & 75 & 7600 & 93 & 89.5 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance of BoVW using SURF as the image feature detector and descriptor. The table represents the number of images used in the training process, while the rest of the database is used for the evaluation purpose. The processing time is measured in seconds.  
Figure 4: Confusion matrices using the SURF feature detector under different database percentages as the training samples. (**a**) Using 30% of the database as the training set (30 images out of 105), (**b**) Using 45% of the database as the training set (45 images out of 105), (**c**) Using 60% of the database as the training set (60 images out of 105), and (**d**) Using 75% of the database as the training set (75 images out of 105). The horizontal axis represents the predicted class while the vertical axis represents the true class.