Cosine Similarity as a Distance Metric for Javanese Script Image Recognition Classification

Authors

  • ID Aji Priyambodo Institut Teknologi dan BIsnis Semarang, Semarang, Indonesia
  • ID Prihati Institut Teknologi dan Bisnis Semarang, Semarang, Indonesia
  • ID Danang Universitas Sains dan Teknologi Komputer, Semarang, Indonesia
  • MY Farhan bin Mohamed Universiti Teknologi Malaysia, Kuala Lumpur, Malaysia

DOI:

https://doi.org/10.30812/matrik.v25i2.4123

Keywords:

Cosine similarity, Distance metric, Image recognition, Javanese script classification

Abstract

Javanese character (Hanacaraka) recognition presents significant challenges due to the intricate patterns and variations in character features. Addressing these issues is crucial for digitizing cultural heritage and supporting educational applications. This study aims to evaluate the effectiveness of cosine similarity as a distance metric for classifying Javanese characters, comparing its performance against traditional Euclidean and Manhattan distance metrics. The research used a feature-extraction technique based on the histogram of oriented gradients and evaluated cosine similarity across different classification models. Model performance was assessed using precision, recall, F1-score, and accuracy metrics. The results showed that cosine similarity, when combined with a support vector machine, achieved an accuracy of 99.84%, significantly outperforming other distance metrics. When applied to another classification model, cosine similarity improved accuracy to 90%, demonstrating its robustness in handling complex patterns. Parameter optimization was performed using a grid-based search, and model reliability was assessed through cross-validation. Compared with previous studies that primarily relied on deep learning, this research offers an alternative method that balances efficiency and accuracy while maintaining high interpretability. The findings establish a new benchmark for Javanese character recognition and highlight the potential of cosine similarity in broader applications. Future research can expand this study by incorporating more diverse feature extraction techniques, larger datasets, and hybrid approaches to further enhance recognition performance.

Downloads

Download data is not yet available.

References

[1] A. Susanto, I. U. W. Mulyono, C. A. Sari, E. H. Rachmawanto, and R. R. Ali, “Javanese Character Recognition Based on

K-Nearest Neighbor and Linear Binary Pattern Features,” Kinetik: Game Technology, Information System, Computer Network,

Computing, Electronics, and Control, vol. 7, no. 3, August 2022, https://doi.org/10.22219/kinetik.v7i3.1491.

[2] M. A. Rasyidi, T. Bariyah, Y. I. Riskajaya, and A. D. Septyani, “Classification of handwritten Javanese script using random

forest algorithm,” Bulletin of Electrical Engineering and Informatics, vol. 10, no. 3, pp. 1308–1315, Jun. 2021, https://doi.org/

10.11591/eei.v10i3.3036.

[3] A. Susanto, I. U. Wahyu Mulyono, C. Atika Sari, E. Hari Rachmawanto, D. R. Ignatius Moses Setiadi, and M. K. Sarker,

“Handwritten Javanese script recognition method based 12-layers deep convolutional neural network and data augmentation,”

IAES International Journal of Artificial Intelligence (IJ-AI), vol. 12, no. 3, p. 1448, Sep. 2023, https://doi.org/10.11591/ijai.v12.

i3.pp1448-1458.

[4] D. U. K. Putri, D. N. Pratomo, and A. Azhari, “Hybrid convolutional neural networks-support vector machine classifier with

dropout for Javanese character recognition,” TELKOMNIKA (Telecommunication Computing Electronics and Control), vol. 21,

no. 2, p. 346, Apr. 2023, https://doi.org/10.12928/telkomnika.v21i2.24266.

[5] F. T. Anggraeny, Y. V. Via, and R. Mumpuni, “Image preprocessing analysis in handwritten Javanese character recognition,”

Bulletin of Electrical Engineering and Informatics, vol. 12, no. 2, pp. 860–867, Apr. 2023, https://doi.org/10.11591/eei.v12i2.

4172.

[6] A. Susanto, C. A. Sari, E. H. Rachmawanto, I. U. W. Mulyono, and N. Mohd Yaacob, “A Comparative Study of Javanese Script

Classification with GoogleNet, DenseNet, ResNet, VGG16 and VGG19,” Scientific Journal of Informatics, vol. 11, no. 1, pp.

31–40, Jan. 2024, https://doi.org/10.15294/sji.v11i1.47305.

[7] M. F. Naufal, J. Siswantoro, and J. T. Soebroto, “Transliterating Javanese Script Images to Roman Script using Convolutional

Neural Network with Transfer Learning,” JOIV : International Journal on Informatics Visualization, vol. 8, no. 3, p. 1460, Sep.

2024, https://doi.org/10.62527/joiv.8.3.2566.

[8] I. F. Katili, M. A. Soeleman, and R. A. Pramunendar, “Character Recognition of Handwriting of Javanese Character Image

using Information Gain Based on the Comparison of Classification Method,” Jurnal RESTI (Rekayasa Sistem dan Teknologi

Informasi), vol. 7, no. 1, pp. 193–200, Feb. 2023, https://doi.org/10.29207/resti.v7i1.4488.

[9] N. Xie, M. Xiong, F. Wei, T. Zhang, Z. Yang, and W. Yu, “CA-LOSS: A Cosine Affinity Loss for Imbalanced SAR Ship

Classification,” in IGARSS 2024 - 2024 IEEE International Geoscience and Remote Sensing Symposium. Athens, Greece:

IEEE, Jul. 2024, pp. 9070–9074, https://doi.org/10.1109/IGARSS53475.2024.10640754.

[10] X. Qiao, S. K. Roy, and W. Huang, “3-D Sharpened Cosine Similarity Operation for Hyperspectral Image Classification,”

IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 17, pp. 1114–1125, November, 2024,

https://doi.org/10.1109/JSTARS.2023.3337112.

[11] Z. Wang, J. Chen, and J. Hu, “Multi-View Cosine Similarity Learning with Application to Face Verification,” Mathematics,

vol. 10, no. 11, p. 1800, May 2022, https://doi.org/10.3390/math10111800.

[12] S. Palanisamy and J. Periyasamy, “Interval-Valued Intuitionistic Fuzzy Cosine Similarity Measures for Real World Problem

Solving,” International Journal of Robotics and Control Systems, vol. 4, no. 2, pp. 655–677, May 2024, https://doi.org/10.

31763/ijrcs.v4i2.1251.

[13] K. Endo, M. Tanaka, and M. Okutomi, “CNN-Based Classification of Degraded Images Without Sacrificing Clean Images,”

IEEE Access, vol. 9, pp. 116 094–116 104, August, 2021, https://doi.org/10.1109/ACCESS.2021.3105957.

[14] R. Wang, T. Chen, P. Yao, S. Liu, I. Rajapakse, and A. O. Hero, “ASK: Adversarial Soft k-Nearest Neighbor Attack and

Defense,” IEEE Access, vol. 10, pp. 103 074–103 088, September, 2022, https://doi.org/10.1109/ACCESS.2022.3209243.

[15] Q.-H. Nguyen, C. Q. Nguyen, D. D. Le, and H. H. Pham, “Enhancing Few-Shot Image ClassificationWith Cosine Transformer,”

IEEE Access, vol. 11, pp. 79 659–79 672, July, 2023, https://doi.org/10.1109/ACCESS.2023.3298299.

[16] M. Shulgin and I. Makarov, “Scalable Zero-Shot Logo Recognition,” IEEE Access, vol. 11, pp. 142 702–142 710, December,

2023, https://doi.org/10.1109/ACCESS.2023.3342721.

[17] A. Naseer, H. A. Alzahrani, N. A. Almujally, K. A. Nowaiser, N. A. Mudawi, A. Algarni, and J. Park, “Efficient Multi-Object

Recognition Using GMM Segmentation Feature Fusion Approach,” IEEE Access, vol. 12, pp. 37 165–37 178, March, 2024,

https://doi.org/10.1109/ACCESS.2024.3372190.

[18] M. Mohammadi, M. Eftekhari, and A. Hassani, “Image-Text Connection: Exploring the Expansion of the DiversityWithin Joint

Feature Space Similarity Scores,” IEEE Access, vol. 11, pp. 123 209–123 222, October, 2023, https://doi.org/10.1109/ACCESS.

2023.3327339.

[19] X. Li, H. Belcher, and H. Wang, “Robust Spherical Laplacian Embedding,” IEEE Transactions on Neural Networks and Learning

Systems, vol. 36, no. 4, pp. 7594–7605, Apr. 2025, https://doi.org/10.1109/TNNLS.2024.3401010.

[20] H. Wang, “Clustering statistical method of high dimensional sparse data based on fuzzy data,” Journal of Physics: Conference

Series, vol. 2791, no. 1, p. 012060, Jul. 2024, https://doi.org/10.1088/1742-6596/2791/1/012060.

[21] I. T. Ahmed, B. T. Hammad, and N. Jamil, “A Comparative Performance Analysis of Malware Detection Algorithms Based

on Various Texture Features and Classifiers,” IEEE Access, vol. 12, pp. 11 500–11 519, January, 2024, https://doi.org/10.1109/

ACCESS.2024.3354959.

[22] R. Rofik, R. A. Hakim, J. Unjung, B. Prasetiyo, and M. A. Muslim, “Optimization of SVM and Gradient Boosting Models Using

GridSearchCV in Detecting Fake Job Postings,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer,

vol. 23, no. 2, pp. 419–430, Mar. 2024, https://doi.org/10.30812/matrik.v23i2.3566.

Downloads

Published

2026-03-11

Issue

Section

Articles

How to Cite

[1]
A. P. Priyambodo, P. Prihati, D. Danang, and Farhan bin Mohamed, “Cosine Similarity as a Distance Metric for Javanese Script Image Recognition Classification”, MATRIK, vol. 25, no. 2, pp. 323–334, Mar. 2026, doi: 10.30812/matrik.v25i2.4123.

Similar Articles

1-10 of 126

You may also start an advanced similarity search for this article.