An Improved k-Nearest Neighbor Algorithm for Recognition and Classification of Thyroid Nodules

J Ultrasound Med. 2024 Jun;43(6):1025-1036. doi: 10.1002/jum.16429. Epub 2024 Feb 23.

Abstract

Objectives: To complete the task of automatic recognition and classification of thyroid nodules and solve the problem of high classification error rates when the samples are imbalanced.

Methods: An improved k-nearest neighbor (KNN) algorithm is proposed and a method for automatic thyroid nodule classification based on the improved KNN algorithm is established. In the improved KNN algorithm, we consider not only the number of class labels for various classes of data in KNNs, but also the corresponding weights. And we use the Minkowski distance measure instead of the Euclidean distance measure.

Results: A total of 508 ultrasound images of thyroid nodules, including 415 benign nodules and 93 malignant nodules, were used in the paper. Experimental results show the improved KNN has 0.872549 accuracy, 0.867347 precision, 1 recall, and 0.928962 F1-score. At the same time, we also considered the influence of different distance weights, the value of k, different distance measures on the classification results.

Conclusions: A comparison result shows that our method has a better performance than the traditional KNN and other classical machine learning methods.

Keywords: Minkowski distance; distance metric; distance weight; k‐nearest neighbor; thyroid nodule.

MeSH terms

  • Algorithms*
  • Humans
  • Image Interpretation, Computer-Assisted / methods
  • Pattern Recognition, Automated / methods
  • Reproducibility of Results
  • Thyroid Gland / diagnostic imaging
  • Thyroid Nodule* / classification
  • Thyroid Nodule* / diagnostic imaging
  • Ultrasonography* / methods