# Approach for Tattoo Detection and Identification Based on YOLOv5 and Similarity Distance
## 6 Conclusions  
In this paper, a solution for automated tattoo detection and identification was implemented. This task is multi-stage as it requires both tattoo detection, its bounds estimation, as well as comparison to the reference tattoo. Such a solution, when the second stage is implemented based on similarity rather than the trained model, has the advantage of the easy extension of the reference dataset; there is no need to retrain the model for added reference tattoos.  
After investigation of photo augmentation and the impact of the YOLOv5 hyperparameter on tattoo detection, the highest values of [EMAIL_ADDRESS] (0.82) and [EMAIL_ADDRESS]:0.95 (0.63) have been obtained. Those were obtained using the YOLOv5l model, with the learning rate set at 0.001, momentum set at 0.95, and the weight decay set at 0.0001, while the photos were augmented using 90\({}^{\circ}\) rotation, shear, and blur options. This model was not only able to achieve the best detection but led to the highest recall. This is important as it is  
Figure 5: Tattoo identification accuracy scores for cosine similarity and Euclidean distance when only the most similar reference tattoo is taken as the model prediction.  
better to have a bigger set of instances for the next stage rather than miss some tattoos or its elements.  
In the similarity estimation between tattoos, the highest accuracy in linking the tattoo photo with one reference tattoo with the highest similarity score reached 98%, while the F-score is up to 52%. This would not be an acceptable accuracy for criminal identification or similar tasks. However, the similarity score can be used for the reduction of manual work revising the possible candidates. By applying cosine similarity, all cases where similarity is less than the threshold value of 0.15 can be ignored. This would decrease the workload by 20% while no False-negative cases would be skipped.  
The results obtained during the experimental investigation have shown that tattoo detection and identification tasks require larger models than YOLOv5n. Additionally, the learning rate, momentum, and decay weight parameters have not influenced the results too much. Considering the possible implementation of the models obtained in the real environment, such as real-time detection systems, the most suitable are YOLOv5m and YOLOv5l. The training time of these models is lower compared to that of the YOLOv5x; therefore, it would be easy to retrain the models using more tattoo images and improve the quality of tattoo detection. In the future, the newest versions of YOLO could be trained and tested under the same conditions to see how it influences the results of tattoo detection and identification.  
Conceptualization, G.P., P.S. and S.R.; methodology, P.S. and S.R.; validation, G.P., E.P. and S.R.; formal analysis, G.P. and P.S.; data curation, G.P., E.P. and P.S.; writing--original draft preparation, G.P., E.P., P.S. and S.R.; writing--review and editing P.S. and S.R., visualization, G.P. and P.S.; supervision, P.S. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
Dataset available on request from the authors.  
The authors declare no conflicts of interest.