GWKNN: an enhanced k-nearest neighbor algorithm with G metric reconstruction and Grey Wolf Optimizer

k-nearest neighbors (KNN) is a classic supervised classification method widely used in pattern recognition and data mining. However, traditional KNN may lead to a decline in discriminant performance in high-dimensional feature spaces due to degraded distance measurements. At the same time, when class distributions are uneven, its equal-weight voting mechanism is prone to decision bias, thereby affecting the fairness of classification results. To improve the discrimination ability and adaptability of the KNN algorithm in a complex data environment, this paper proposes an enhanced k-Nearest Neighbors with G metric reconstruction and inverse class frequency weighting (GWKNN). Based on retaining the KNN algorithm model structure, this method introduces the Grey Wolf Optimizer to perform global adaptive reconstruction of the distance matrix between samples to more effectively characterize the nonlinear structure and semantic association in the feature space and alleviate the failure problem of traditional Euclidean distance in non-Euclidean space. To address the neighborhood decision bias caused by multi-category imbalance, an inverse class frequency weighting strategy based on category prior frequency was designed to suppress the dominant effect of the majority class from the voting mechanism level, thereby improving the model's sensitivity to minority class samples and the overall classification fairness. Comparative experiments across 12 public datasets show that the proposed GWKNN algorithm outperforms traditional KNN and other mainstream classification methods in terms of classification accuracy and adaptability, demonstrating strong overall performance and practical application potential.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2026-02-26
DOI
https://doi.org/10.1038/s41598-026-41851-2
Primary Topic
Advanced Clustering Algorithms Research
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

GWKNN: an enhanced k-nearest neighbor algorithm with G metric reconstruction and Grey Wolf Optimizer

Zishun Ni, Zhiqing Guo, Guangwei Liu, Wei Liu et al.
Scientific Reports
Advanced Clustering Algorithms Research
article

GWKNN: an enhanced k-nearest neighbor algorithm with G metric reconstruction and Grey Wolf Optimizer

Zishun Ni, Zhiqing Guo, Guangwei Liu, Wei Liu, Feng Jiang
article en

Abstract

k-nearest neighbors (KNN) is a classic supervised classification method widely used in pattern recognition and data mining. However, traditional KNN may lead to a decline in discriminant performance in high-dimensional feature spaces due to degraded distance measurements. At the same time, when class distributions are uneven, its equal-weight voting mechanism is prone to decision bias, thereby affecting the fairness of classification results. To improve the discrimination ability and adaptability of the KNN algorithm in a complex data environment, this paper proposes an enhanced k-Nearest Neighbors with G metric reconstruction and inverse class frequency weighting (GWKNN). Based on retaining the KNN algorithm model structure, this method introduces the Grey Wolf Optimizer to perform global adaptive reconstruction of the distance matrix between samples to more effectively characterize the nonlinear structure and semantic association in the feature space and alleviate the failure problem of traditional Euclidean distance in non-Euclidean space. To address the neighborhood decision bias caused by multi-category imbalance, an inverse class frequency weighting strategy based on category prior frequency was designed to suppress the dominant effect of the majority class from the voting mechanism level, thereby improving the model's sensitivity to minority class samples and the overall classification fairness. Comparative experiments across 12 public datasets show that the proposed GWKNN algorithm outperforms traditional KNN and other mainstream classification methods in terms of classification accuracy and adaptability, demonstrating strong overall performance and practical application potential.

Scientific ReportsVol. 16(1)
Liaoning Technical University (CN), Fuzhou University (CN)
National Natural Science Foundation of China
Openalex Percentile: Top 46%
Advanced Clustering Algorithms Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.