Underwater environmental exploration using sensor nodes has emerged as a critical endeavor fraught with challenges such as localization errors, energy, and costs attributed to the dynamic nature of underwater environments. This paper proposes a KNN-based cost-efficient machine-learning algorithm aimed at optimizing underwater context acquisition with sensor nodes. By addressing existing localization challenges, the algorithm minimizes localization errors, energy consumption and Time costs while significantly enhancing localization accuracy to 99.98%. Furthermore, the study employs the KNN-based cost-efficient method to predict nodes' orientation in dynamic water conditions, thereby facilitating the mapping of the shortest distance between sensor nodes during the underwater context acquisition process. The effectiveness of the proposed KNN-based cost-efficient method is evaluated through real-time experiments conducted in a water tank setup and simulations using the Ns-3.37 version. Results demonstrate notable improvements in localization accuracy by optimizing the localization error rate from 4.59m to [Formula: see text]m, Reducing localization energy consumption rate 0.0045J in addition for the first time we have also computed the localization Time cost rate which is 0.06762s. we assumed that in real-time and in NS-3 simulations on the Aqua-sim model indicate communication speed at 1500m/s. This research presents an innovative and practical approach to resolving challenges associated with underwater context acquisition through sensor nodes, it offers a comprehensive understanding and emphasizes the real-time implementation of the KNN-based cost-efficient approach.
Keywords: KNN-Algorithm; Localization; Machine Learning; NS-3; Prediction; accuracy rate.
© 2025. The Author(s).