# Machine Learning Models for Artist Classification of Cultural Heritage Sketches
## 2 Material and Methods
### Model Development
#### 2.3.3 Vector Embedding Similarity Search  
With the extensive application of large language models (LLMs), knowledge representation is quickly evolving, addressing specific requirements that are not available for traditional encoders (such as the one-hot encoder). One such solution is employing a specific database type, namely, a vector database [34]. These vectors provide an abstraction from the activation maps given by the neural network processing an image. This allows us to map artist-specific features to such vectors and, with this approach, we will provide similarity search capabilities to our database. Our approach used the standard award-winning VGG16 [26] database, which was chosen especially for its simplicity in terms of human understanding, allowing us to evaluate the results of the encoder model. For this special case, an image resizing operation was performed for the shape (512, 512, 3) to correctly map the information within a vector with a shape of (1, 512) as required by the VGG16 model. This workflow did not rely on classical accuracy training and loss but used activation mapping for vectors that were named embeddings, enabling metric extraction between the activation maps provided by the CNN while looking at patterns. While the image preprocessing workflow enhanced the gradients while reducing the background noise and the color map, this approach focused on pen strokes. The IFV_FLAT index was applied for floating point values (provided by the encoder package) to divide the data into the destination tensor containing all data from the VGG activation maps. \[L2(a,b)=L2(b,a)=\sqrt{\sum_{i=0}^{n}-1(b_{i}-a_{i})^{2}}\ \forall\ a=(a_{0}.a_{n});\ b=(b_{0}.b_{n}) \tag{1}\]  
The actual database implementation used a virtualized instance of Milvus [35] without GPU capabilities (hence the choice of indexes in Table 6) to handle communication using \begin{table}
\begin{tabular}{c c c c} \hline
**Epochs** & **Learning Rate** & **Images** & **Classes** & **Val-Accuracy** \\ \hline
272 & 0.004 & 1018 & 5 & 79.27\% \\
272 & 0.004 & 1018 & 5 & 81.10\% \\
272 & 0.004 & 1018 & 5 & **83.23\%** \\
151 & 0.004 & 1018 & 5 & 76.41\% \\
151 & 0.004 & 1018 & 5 & 81.10\% \\
151 & 0.004 & 1018 & 5 & 85.52\% \\
151 & 0.004 & 1018 & 5 & 93.36\% \\
151 & 0.004 & 1018 & 5 & **95.84\%** \\ \hline \end{tabular}
\end{table} 
Table 4: Experimental results for the Faster R-CNN architecture (hyperparameter search). \begin{table}
\begin{tabular}{c c c} \hline
**Name** & **Training Value** & **Validation Value** \\ \hline Loss & 0.1749 & 0.2107 \\ Categorical Accuracy & 0.8336 & 0.8109 \\ Precision & 0.4449 & 0.4382 \\ Recall & 0.8464 & 0.8466 \\ Auc & 0.8492 & 0.8463 \\ \hline \end{tabular}
\end{table} 
Table 5: Experimental results for the Faster R-CNN model training and evaluation for the second sample from Table 4.  
tcp sockets with ML engineering workstations. The image processing workflow included image-encoding algorithms from the Towhee package [36]. The prepared dataset was fed through the Towhee pipeline, and the vectors were included within the database. This processing stage required ML acceleration, and the GPU was used in our approach. This model analyzed the recognition of painters' pen strokes using vector embeddings. Vector embeddings are a powerful technique for representing images as numerical vectors. These vectors capture the essence of an image, allowing for tasks such as image retrieval, similarity search, and image classification. The following is how one can create image embeddings using the VGG16 model. VGG16 is a convolutional neural network (CNN) that is pre-trained on a massive dataset of images (ImageNet) for image classification. It has 16 convolutional layers and fully connected layers that predict image categories. VGG16 excels at extracting high-level features from images, making it a good starting point for creating embeddings. Before feeding the model images, we processed them to ensure consistency.