Development of a Modified Siamese Neural Network for Object Recognition

Authors

  • Ievgen Fedorchenko
  • Andrii Oliinyk
  • Tetiana Fedoronchak
  • Alexander Stepanenko
  • Yevgeny Gofman
  • Vladyslav Prymakov

DOI:

https://doi.org/10.47839/ijc.25.3.4841

Keywords:

Siamese neural networks, convolutional networks, contrastive loss function, triplet loss function, online pair and triplet selection strategies, DrLIM, PyTorch, MNIST

Abstract

The article explores methods for training Siamese neural network for classification and retrieval of similar objects using embeddings. The study focuses on the development and analysis of the effectiveness of various loss functions, including contrastive and triplet loss, as well as training-sample selection strategies such as Batch Hard. The models were implemented in the PyTorch framework, ensuring their flexibility and scalability. The MNIST dataset, a standard benchmark for image-recognition tasks, was used for testing. The scientific novelty of this study lies in applying of a genetic algorithm for the automatic optimization of the margin parameter in loss functions. Traditionally, this parameter is selected manually or determined empirically, which may negatively affect the model’s training quality. The proposed approach enables adaptive tuning of the model to the characteristics of each data batch, improving the model’s generalization ability and enhancing classification accuracy. Experimental results confirmed the effectiveness of the developed approaches. The best performance was demonstrated by the model with the triplet loss function and the Batch Hard strategy, indicating the feasibility of using more advanced sample selection strategies to improve neural network performance. Overall, the study confirms the efficiency of enhanced Siamese network training methods for object - recognition and matching tasks.

References

S. C. Mana, T. Sasipraba, “Research on cosine similarity and Pearson correlation based recommendation models,” Journal of Physics: Conference Series, vol. 1770, issue 1, p. 012014, 2021, https://doi.org/10.1088/1742-6596/1770/1/012014.

S. Mukherjee, R. Sonal, “A reconciliation between cosine similarity and Euclidean distance in individual decision-making problems,” Indian Economic Review, vol. 58, issue 2, pp. 427–431, 2023, https://doi.org/10.1007/s41775-023-00206-8.

P. K. Singh, S. Setta, I. S. Rajput, “A modified Spearman’s rank correlation coefficient for an efficient method of similarity calculation in collaborative filtering-based recommendation,” SSRN Electron. J., 2019, https://doi.org/10.2139/ssrn.3350274.

D. Chicco, “Siamese neural networks: An overview,” Methods in Molecular Biology, pp. 73–94, 2020, https://doi.org/10.1007/978-1-0716-0826-5_3.

R. Mohanasundaram, A. S. Malhotra, R. Arun, P. S. Periasamy, “Deep learning and semi-supervised and transfer learning algorithms for medical imaging,” Deep Learning and Parallel Computing Environment for Bioengineering Systems, pp. 139–151, 2019, https://doi.org/10.1016/B978-0-12-816718-2.00015-4.

H. de Rosa Gustavo, J. P. Papa, “Learning to weight similarity measures with Siamese networks: a case study on optimum-path forest,” Elsevier eBooks, pp. 155–173, 2022, https://doi.org/10.1016/B978-0-12-822688-9.00015-3.

T. Lesort, N. Díaz-Rodríguez, J.-F. Goudou, D. Filliat, “State representation learning for control: An overview,” Neural Networks, vol. 108, pp. 379–392, 2018, https://doi.org/10.1016/j.neunet.2018.07.006.

A. Dhiman, K. Gupta, D. K. Sharma, An Introduction to Deep Learning Applications in Biometric Recognition, in: Trends in Deep Learning Methodologies, Elsevier, 2021, pp. 1–36, https://doi.org/10.1016/B978-0-12-822226-3.00001-5.

R. Hadsell, S. Chopra, Y. LeCun, “Dimensionality reduction by learning an invariant mapping,” 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06), New York, NY, USA, 2006, pp. 1735-1742, https://doi.org/10.1109/CVPR.2006.100.

S. Zhang, Q. Zhang, X. Wei, Y. Zhang, Y. Xia, “Person re-identification with triplet focal loss,” IEEE Access, vol. 6, pp. 78092–78099, 2018, https://doi.org/10.1109/ACCESS.2018.2884743.

A. Hermans, L. Beyer, B. Leibe, “In defense of the triplet loss for Person re-identification,” arXiv: Computer Vision and Pattern Recognition, 2017, https://doi.org/10.48550/arXiv.1703.07737.

F. Schroff, D. Kalenichenko, J. Philbin, “FaceNet: A unified embedding for face recognition and clustering,” Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 815-823, https://doi.org/10.1109/CVPR.2015.7298682.

S. Katoch, S. S. Chauhan, and V. Kumar, “A review on genetic algorithm: past, present, and future,” Multimedia Tools and Applications, vol. 80, issue 5, pp. 8091–8126, 2021, https://doi.org/10.1007/s11042-020-10139-6.

A. Paszke et al., “PyTorch: An imperative style, high-performance deep learning library,” arXiv (Cornell University), 2019, https://doi.org/10.48550/arxiv.1912.01703.

H. Shao, E. Ma, M. Zhu, X. Deng, S. Zhai, “MNIST handwritten digit classification based on convolutional neural network with hyperparameter optimization,” Intelligent Automation & Soft Computing, vol. 36, issue 3, pp. 3595–3606, 2023, https://doi.org/10.32604/iasc.2023.036323.

J. Alsayaydeh, J. Abedalrahim, A. Aziz, M. I. Abbasi, A. W. Y. Khang, “Development of programmable home security using GSM system for early prevention,” ARPN J. Eng. Appl. Sci., vol. 16, issue 1, pp. 88–97, 2021.

W. A. Indra, N. S. Zamzam, A. Saptari, J. A. Alsayaydeh, N. B. Hassim, “Development of security system using motion sensor powered by RF energy harvesting,” Proceedings of the 2020 IEEE Student Conference on Research and Development (SCOReD), Batu Pahat, Malaysia, 2020, pp. 254-258. https://doi.org/10.1109/SCOReD50371.2020.9250984.

A. Kharchenko, I. Fedorchenko, T. Fedoronchak, A. Oliinyk, A. Stepanenko, M. Saman, “The development of a genetic method for predicting the incidence of diabetes,” Proceedings of the 2021 11th International Conference on Advanced Computer Information Technologies (ACIT), Deggendorf, Germany, 2021, pp. 708-713. https://doi.org/10.1109/ACIT52158.2021.9548405.

Z. Zhang, E. Sejdić, “Radiological images and machine learning: Trends, perspectives, and prospects,” Computers in Biology and Medicine, vol. 108, pp. 354–370, 2019, https://doi.org/10.1016/j.compbiomed.2019.02.017.

I. Fedorchenko, A. Oliinyk, О. Stepanenko, T. Zaiko, A. Svyrydenko, D. Goncharenko, “Genetic method of image processing for motor vehicle recognition,” Proceedings of the 2nd International Workshop on Computer Modeling and Intelligent Systems, CMIS 2019, Zaporizhzhia; Ukraine; 15-19 April 2019, vol. 2353, pp. 211-226. https://doi.org/10.32782/cmis/2353-17.

G. Jain, T. Mahara, and K. N. Tripathi, “A survey of similarity measures for collaborative filtering-based recommender system,” Soft Computing: Theories and Applications, vol. 1053, pp. 343–352, 2020. https://doi.org/10.1007/978-981-15-0751-9_32.

I. Izonin, R. Tkachenko, N. Shakhovska, N. Lotoshynska, “The additive input-doubling method based on the SVR with nonlinear kernels: Small data approach,” Symmetry, vol. 13, issue 4, 612, 2021. https://doi.org/10.3390/sym13040612.

F. Fkih, “Similarity measures for collaborative filtering-based recommender systems: Review and experimental comparison,” Journal of King Saud University – Computer and Information Sciences, vol. 34, no. 9, pp. 7645–7669, 2022. https://doi.org/10.1016/j.jksuci.2021.09.014.

A. Gazdar and L. Hidri, “A new similarity measure for collaborative filtering based recommender systems,” Knowledge-Based Systems, vol. 188, Art. 105058, 2020. https://doi.org/10.1016/j.knosys.2019.105058.

C. R. Lee and K. Kim, “An improved similarity measure for collaborative filtering-based recommendation system,” Knowledge-Based Systems, vol. 26, no. 2, pp. 137-147, 2022. https://doi.org/10.3233/KES220013.

N. Nudrat et al., “Users’ rating predictions using collaborating filtering based on users and items similarity measures,” Computational Intelligence and Neuroscience, vol. 2022, 2347641, pp. 1-13, 2022. https://doi.org/10.1155/2022/2347641.

Downloads

Published

2026-09-30

How to Cite

Fedorchenko, I., Oliinyk, A., Fedoronchak, T., Stepanenko, A., Gofman, Y., & Prymakov, V. (2026). Development of a Modified Siamese Neural Network for Object Recognition. International Journal of Computing, 25(3), 457-466. https://doi.org/10.47839/ijc.25.3.4841

Issue

Section

Articles