1. Introduction
Wireless sensor networks (WSNs) have garnered substantial research interest due to their wide range of applications in environmental monitoring, healthcare, military surveillance, and industrial automation. One of the primary challenges in WSNs is energy efficiency, as sensor nodes are battery-powered and often deployed in remote or inaccessible locations. To address this challenge, researchers have proposed various clustering-based routing protocols to optimize energy consumption and extend network lifetime. The earliest breakthrough in clustering-based WSNs was introduced by Heinzelman et al., who proposed the low-energy adaptive clustering hierarchy (LEACH) protocol [
1]. LEACH introduced a hierarchical clustering approach, where cluster heads (CHs) were randomly elected in each round to evenly distribute the energy load across the network. The incorporation of data aggregation at cluster heads significantly reduces redundant transmissions, improving network efficiency. However, LEACH experiences uneven energy depletion, particularly among CHs, leading to rapid node failures.
To address the limitations of the LEACH protocol, Manjeshwar and Agrawal developed TEEN (threshold-sensitive energy efficient network), which introduced a hard and soft threshold mechanism to regulate data transmission [
2]. This mechanism minimizes unnecessary transmissions in time-critical applications, but this is not well-suited for applications requiring periodic data reporting. Building upon LEACH, the authors in [
3] introduced PEGASIS (power-efficient gathering in sensor information systems), which replaced the cluster structure with a chain-based formation to minimize transmission distances. PEGASIS effectively extends network lifetime by ensuring that only one node transmits to the base station per round, though it introduces increased latency due to sequential transmissions. Recognizing the need for distributed clustering approaches, another study introduced HEED (hybrid energy-efficient distributed clustering), which used residual energy and communication cost as primary metrics for cluster formation [
4]. Unlike LEACH, which randomly selects CHs, HEED ensures a more even energy distribution, leading to better network stability. Around the same time, in [
5], the authors developed SEP (stable election protocol), specifically designed for heterogeneous networks with nodes having different energy levels. SEP introduces weighted probabilities for CH selection, extending the lifetime of high-energy nodes and improving overall network stability.
In subsequent years, further refinements had been made to improve the adaptability and efficiency of clustering algorithms. Wang et al. introduced a distributed energy-efficient clustering algorithm, which optimized CH selection by considering both energy levels and network topology [
6]. Their method helps maintain load balance and reduce premature node depletion. Meanwhile, El Khediri et al. proposed a K-means and K-medoids clustering-based approach, which leveraged unsupervised learning techniques to form well-balanced clusters, improving both energy consumption and data transmission efficiency [
7].
As research progressed, optimization and AI-based methods began influencing WSN clustering. Mahajan and Sharma proposed fuzzy logic-based CH selection, which dynamically adjusted selection criteria based on energy levels and node density, ensuring a more intelligent decision-making process [
8]. Despite significant advancements in clustering-based WSN protocols, optimizing energy efficiency, network resiliency, and coverage preservation remains a critical challenge. A study [
9] introduced a self-stabilizing lifetime optimization algorithm that dynamically replaced failed nodes to enhance network resilience, particularly in high-density deployments, where redundancy could be exploited. Similarly, in another study [
10], the authors proposed an adaptive clustering-based dynamic routing approach using generalized ant colony optimization. By modeling sensor nodes as artificial ants that dynamically select energy-efficient paths, their method significantly improves network lifetime and reliability while reducing transmission overhead. To enhance clustering efficiency, Ghasemzadeh et al. [
11] developed BN-LEACH, a Bayesian network-based extension of LEACH that refined CH selection by incorporating distance to the base station, residual energy, and node density. This probabilistic approach ensures a more uniform CH distribution, balancing energy consumption and reducing premature node depletion. Additionally, Shankara et al. [
12] introduced a hybrid harmony search algorithm (HSA)–particle swarm optimization (PSO) model, leveraging HSA’s search efficiency and PSO’s adaptability to improve energy-aware CH selection. Their method demonstrates significant improvements in residual energy preservation and throughput, reinforcing the potential of hybrid metaheuristic techniques for WSN optimization.
Beyond clustering and routing, efficient node deployment plays a crucial role in ensuring sustained network performance. In [
13], the authors addressed the connected target coverage problem in WSNs for wind farm monitoring by proposing a deterministic relay node deployment algorithm. Their approach utilizes fermat points and convex hull-based relay placement to establish optimal multi-hop connectivity in large-scale deployments. In another study [
14], the authors introduced an improved LEACH algorithm, integrating concepts from both LEACH and stable election protocol to optimize CH computation and selection. This approach aims to reduce the mortality rate of sensor nodes by refining the cluster formation process and improving data aggregation before transmission to the base station [
14].
Recently, the integration of machine learning and optimization techniques in clustering has become more prevalent. El Khediri et al. proposed an improved K-means clustering algorithm to enhance node localization and cluster formation in WSNs [
15]. Their approach considers network topology constraints and employed optimal K-means to ensure a uniform spatial distribution of cluster heads, leading to more balanced energy consumption across the network [
15]. Expanding on the potential of unsupervised learning, Tadros et al. introduced an unsupervised learning-based clustering method specifically designed for environmental pollution monitoring [
16]. By combining K-means clustering with hierarchical LEACH, their model enables efficient decision making for water-quality monitoring applications, demonstrating its applicability in real-world WSN deployments [
16]. The integration of hierarchical clustering techniques further refines energy-efficient WSN protocol. Zeng et al. introduced a threshold-driven K-means sector clustering algorithm, which incorporated symmetrical sector division and energy-aware cluster head selection. Their model achieved balanced cluster sizes, reducing hotspot issues where certain nodes consumed excessive energy due to heavy traffic loads [
17]. In another study [
18], the authors explored the synergistic integration of K-means clustering with the LEACH protocol, prioritizing nodes with higher residual energy and optimal spatial distribution. Their empirical validation demonstrated significant improvements in network longevity and communication efficiency, setting a benchmark for future WSN clustering strategies [
18]. Further refinements in hierarchical clustering methodologies were introduced by proposing LEACH-Kmeans, an enhanced version of LEACH incorporating K-means clustering for more optimal CH selection. This technique significantly reduces energy consumption and improved network lifespan, highlighting the advantages of machine learning-driven clustering over traditional random selection mechanisms [
19]. From the early hierarchical approaches like LEACH to modern machine learning-based clustering protocols, the evolution of WSN clustering techniques has focused on optimizing energy consumption, enhancing network scalability, and improving communication efficiency. The adoption of K-means clustering, Bayesian networks, and fuzzy logic has significantly improved CH selection and energy balancing, yet challenges remain in dynamic coverage adaptation and real-time energy-aware clustering.
Our contribution focuses on developing a robust and adaptive clustering framework for WSNs, designed to address challenges such as uneven energy depletion, constrained node placement, and unreliable communication. As a novel approach, we introduce a kernel density estimation (KDE)-based node deployment strategy that enables terrain-aware and spatially adaptive placement, ensuring energy-balanced coverage even under real-world constraints. The objective, to prolong network lifetime, optimize energy usage, and maintain reliable communication, is achieved through a synergy of key components: (1) silhouette-based optimal cluster count selection for balanced clustering, (2) Bayesian cluster head selection combining prior knowledge and real-time energy-distance likelihoods, enhanced with Gaussian noise to model sensing uncertainty, (3) dynamic CH eligibility and adaptive weighting to reflect network energy conditions, (4) cluster viability checks to avoid redundant CH assignment, (5) adaptive coverage radius control to conserve energy, and (6) CSMA/CA (carrier sense multiple access with collision avoidance)-based communication to reduce contention and packet loss.
These integrated mechanisms collectively align with core WSN performance metrics: extended network lifetime through energy efficient CH rotation, improved energy efficiency via optimized placement and adaptive transmission, sustained sensing coverage through residual energy-based radius scaling, and enhanced reliability via contention-aware communication. The proposed framework is not only scalable and lightweight but also adaptable to terrain-constrained deployments, making it well-suited for real-world WSN applications such as environmental monitoring, smart agriculture, and industrial automation. The rest of the paper is organized as follows.
Section 2 of this article describes the methodology of the proposed approach. The experimental setup including the initial simulation parameters and the results are presented in
Section 3 and
Section 4, respectively, followed by
Section 5, which provides a detailed discussion of the performance of this novel approach. Finally,
Section 6 provides the conclusions and a discussion on potential future work.
4. Results
Figure 3 illustrates the impact of different sensor deployment strategies on network coverage and energy efficiency. Random uniform deployment ensures an even spatial distribution but lacks density optimization, leading to coverage gaps and uneven energy consumption [
1]. These inconsistencies affect the cluster formation and overall network performance. Gaussian-based deployment, which results in a higher concentration of nodes near the center, improves connectivity near the sink [
30]. However, it also causes coverage redundancy and localized energy depletion. In contrast, the KDE-based deployment optimizes sensor placement using probabilistic density estimation, ensuring balanced coverage and energy distribution. This enhances network longevity, making it a more effective deployment strategy for sustainable WSN operations. The heatmaps use a color gradient from pale to dark blue to represent the estimated sensor node density, where darker regions indicate higher concentrations of nodes.
The performance of the proposed KDE-based clustering framework was evaluated over 5000 simulation rounds using 100 sensor nodes deployed via kernel density estimation. This adaptive deployment strategy provides spatial balance by aligning node placement with estimated spatial density distributions, unlike conventional uniform or random deployments. For this particular simulation, the optimal KDE bandwidth was automatically selected as 10.61 m using leave-one-out cross-validation. Based on silhouette score analysis, the optimal number of clusters was determined to be 6, as illustrated in
Figure 4a, with the resulting cluster structure shown in
Figure 4b. Due to stochastic factors such as KDE sampling and K-means initialization, both the selected bandwidth and number of clusters may vary across different runs, demonstrating the method’s flexibility in adapting to spatial conditions and distinguishing it from traditional K-means clustering, which fixes the number of clusters a priori.
Figure 5 presents the gradual decline in each node’s coverage radius in response to residual energy, and
Figure 6 demonstrates how this affects the overall network coverage area, decreasing from 97.76% at round 1 to just 20.39% at round 4500.
Figure 7 highlights the temporal progression of CH locations, while
Figure 8 illustrates the trends in alive and dead node counts throughout the simulation. All 100 nodes remained alive and active until round 3754, with the first node death recorded at round 3755. From round 4000 onward, the rate of node failure gradually increased and intensified further after round 4500. At round 4500, the network retained 27 operational nodes, which were dynamically organized into four active clusters, each led by a functioning cluster head. This confirms the framework’s ability to maintain network operability and adaptively restructure clusters under energy-constrained conditions. The simulation terminated at round 4799, when no eligible nodes remained to form viable cluster heads. Although three nodes were still technically alive at round 5000, all had residual energy levels below the threshold required for communication, rendering them non-functional from a network perspective. The integration of KDE-based deployment, Bayesian CH selection with energy uncertainty modeling, adaptive coverage, and CSMA/CA communication collectively contributed to a significant extension in network lifetime, improved energy balance, and more resilient connectivity under practical WSN constraints. Moreover, to evaluate the impact of sensing uncertainty on network degradation, we experimented and simulated the proposed Bayesian CH selection model under two different standard deviations (
and
) of Gaussian noise applied to residual energy perception. As shown in
Figure 9, higher noise levels accelerated node death, with
leading to earlier and steeper increases in dead node count, thereby demonstrating the sensitivity of WSN performance to energy estimation fidelity.
To ensure a fair comparison with state-of-the-art methods, we evaluated the simulation results of our proposed approach against LEACH [
19] and K-means-based clustering techniques, including K-LEACH [
18] and LEACH-Kmeans [
19]. The simulations were conducted using the same parameters to perform a consistent and unbiased comparison. As observed in
Figure 10, our proposed method consistently outperforms K-LEACH in terms of node survival over simulation rounds, maintaining a higher number of alive nodes for an extended period, which indicates better energy management and prolonged network lifetime. Unlike K-LEACH, which relies on K-means clustering for cluster head selection, the proposed method dynamically adapts the cluster formation based on KDE, optimizing coverage while ensuring balanced energy consumption among nodes. Similarly,
Figure 11 illustrates the comparison with LEACH and LEACH-Kmeans, where the proposed method exhibits superior energy conservation and a slower rate of node depletion. While LEACH suffers from random CH selection, and LEACH-Kmeans improves stability through structured clustering, neither fully accounts for adaptive energy-based coverage adjustments, which is a key strength of the proposed method. The results demonstrate that this proposed method achieves enhanced energy efficiency and extended network lifespan compared to the traditional and K-means-based clustering methods, making it a more robust solution for energy-constrained wireless sensor networks.
5. Discussion
The proposed KDE-based clustering framework offers a practical and scalable solution for enhancing WSN performance by integrating spatially optimized node deployment, adaptive clustering, and energy-efficient communication. One of the key innovations is the use of kernel density estimation (KDE) for terrain-adaptive sensor deployment. Unlike random or uniform placement strategies, KDE allows nodes to be distributed based on real-world constraints such as terrain features, accessibility, and application-specific coverage priorities. This results in more balanced energy consumption, reduced hotspots, and improved overall coverage efficiency. The framework’s flexibility also makes it suitable for mission-driven WSN applications such as environmental monitoring, smart agriculture, and urban sensing.
On the clustering side, we incorporate a Bayesian cluster head (CH) selection mechanism that adapts to residual energy and node location. To account for imperfect energy sensing, caused by noise or communication delays, a small Gaussian noise is added during CH ranking, allowing the algorithm to model uncertainty realistically without affecting energy depletion logic. Additionally, the decision weight factor is dynamically adjusted based on the network’s average energy level, balancing the influence of prior probabilities and real-time observations throughout the simulation. Cluster viability is further ensured by filtering out inactive clusters using a functional node check, which prevents CH assignment in depleted or isolated regions.
For communication, CSMA/CA is employed to enable collision avoidance through randomized backoff. This improves transmission reliability, reduces packet loss, and reflects the realities of shared wireless channels. To conserve energy further, coverage radii are adjusted dynamically based on each node’s remaining energy, enabling high-energy nodes to maintain wider sensing ranges while low-energy nodes reduce their load.
These components collectively contribute to four core performance metrics emphasized in WSN research: extended network lifetime, improved energy efficiency, sustained coverage, and reliable communication. Network lifetime is significantly prolonged by dynamically selecting cluster heads based on residual energy and distance, thereby preventing premature node failure. Energy efficiency is achieved through optimal node placement, minimal intra-cluster transmission distances, and adaptive sensing radii, all of which reduce unnecessary energy expenditure. The adaptive coverage model maintains sensing effectiveness across the network lifespan by proportionally adjusting each node’s coverage based on its remaining energy. Meanwhile, communication reliability is improved by incorporating CSMA/CA during data transmission, which reduces channel contention and minimizes the risk of packet collisions in a wireless medium. The simulation results of the proposed method demonstrate that the network maintains connectivity longer, minimizes energy waste, and preserves sensing coverage more effectively than baseline approaches. Additionally, the simulation halts automatically when no CHs can be elected, either due to complete energy depletion or a lack of viable clusters, reflecting realistic network shutdown conditions where nodes, although still alive, can no longer sustain communication.
From a computational standpoint, the framework remains lightweight. KDE-based node deployment and cluster count optimization are performed once with complexity. Each simulation round involves CH selection, CSMA/CA logic, and energy updates with a practical complexity of , which is effectively linear when k is small. The full simulation (100 nodes, 5000 rounds) runs in approximately 110 s on a standard workstation (Intel(R) Core(TM) i5-8265U CPU @ 1.60 GHz, 8 GB RAM), confirming the framework’s efficiency and scalability.