International Journal of Electrical and Computer Engineering (IJECE) Vol. No. October 2025, pp. ISSN: 2088-8708. DOI: 10. 11591/ijece. Enhancing internet of things network efficiency with clustering and random forest fusion techniques Ahmed Gamal Soliman Soliman Deabes1. Hani Attar2,3. Jafar Ababneh4. Hala Abd El-kader Mansour5. Michael Nasief5. Esraa M. Eid5,6 Department of Electronics and Communication Engineering. Modern University for Technology and Information. Cairo. Egypt Faculty of Engineering. Zarqa University. Zarqa. Jordan College of Engineering. University of Business and Technology. Jeddah. Saudi Arabia Cyber Security Department. Faculty of Information Technology. Zarqa University. Zarqa. Jordan Department of Electrical Engineering. Faculty of Engineering at Shoubra. Benha University. Shoubra. Egypt Faculty of Computer Science. Benha National University. Benha. Egypt Article Info ABSTRACT Article history: The internet of things (IoT) is a key element of the future internet, enabling the acquisition and transfer of data to improve efficiency. One challenge in IoT networks is managing the energy consumption of nodes. IoT innovation constantly evolves dynamically, contributing significantly to sustainable cities and economies. Clustering techniques can help conserve energy and extend the operational lifespan of network nodes. Cluster heads (CH) manage all cluster member (CM) nodes within their group, establishing intra-cluster and inter-cluster connections. Enhancing the CH selection process can further prolong the network lifespan. Various algorithms aim to extend the active duration of IoT nodes and the overall network lifespan. comparison of the five algorithms shows that one algorithm is better than the others in some cases. This paper discusses how fusion techniques using the random forest (RF) algorithm can enhance energy efficiency in IoT Five algorithms are compared using RF, a robust machinelearning algorithm renowned for its ensemble learning capabilities. It selects the best one based on active nodes per round, residual energy for each round, and the average end-to-end delay. Received Aug 11, 2024 Revised Mar 18, 2025 Accepted Jun 30, 2025 Keywords: Cluster head Cluster member Energy Internet of things Random forest This is an open access article under the CC BY-SA license. Corresponding Author: Ahmed Gamal Soliman Soliman Deabes Department of Electronics and Communication Engineering. Faculty of Engineering. Modern University for Technology and Information 165. El Thawra St. , 6th district. Nasr City. Cairo. Egypt Email: ahmed_deabes2009@yahoo. INTRODUCTION An Internet-based network of physical items or devices that can interact and communicate with humans and each other is known as the internet of things (IoT) . With estimates indicating there will be over 29 billion cellular IoT connections by 2030, the IoT is predicted to grow significantly . The rapid advancement of IoT technology has led to the development of numerous applications that have the potential to impact our daily life . By integrating intelligence into various domains. IoT technologies are used to enhance our surroundings and create smart cities, buildings, agriculture, and flexible energy infrastructure . Smart agriculture is the smart way to switch irrigation systems on and off depending on actual humidity sensor data based on the field. This automatic system improves irrigation and allows farmers to monitor and manage operations remotely. It also provides data for deep evaluation and analysis . IoT helps devices share info, send and get commands, and talk to each other independently without help. Journal homepage: http://ijece. Int J Elec & Comp Eng ISSN: 2088-8708 Hierarchical routing is a possible solution for prolonging the life of IoT devices. This system organizes the nodes into clusters. A leader node called a cluster heads (CH) manages the cluster. In the network, as shown in Figure 1, the cluster head acts as the mediator between the nodes in the cluster and the primary base station, which helps minimize the hops and save power . It enables network scalability, reduces traffic, and improves performance. As a result, it enhances battery lifespan and improves the overall network duration . Figure 1. The overview contains CHs as well as a base stasion (BS) Multiple cluster member (CM) nodes are connected to a single CH node . The CM nodes operate as regular nodes within the network, performing various tasks according to the network's protocol. The CH node oversees network management and coordinates the activities of CM nodes . Generally, the CH node has more advanced capabilities than the CM nodes and is responsible for additional tasks such as maintaining cluster topology and routing data between CM nodes . This routing strategy leads to significant energy savings and substantially decreased communications between IoT nodes. The CH node is responsible for data transfer and connection within a cluster, adapting to dynamic network conditions. Numerous algorithms are designed to enhance IoT networks' longevity and energy efficiency. , it focuses on comparing five algorithms. This paper aims to employ the random forest fusion technique, a machine learning algorithm, to select the best result value for clustering techniques. The first algorithm, the low energy adaptive clustering hierarchy (LEACH), uses clustering to help lower power consumption. Based on cluster rotation, it chooses a small number of CHs, which additional nodes then join to create clusters. After being delivered to the relevant CH for aggregation, the data is subsequently forwarded to the BS by the CH . The second algorithm is the genetic algorithm (GA), which evaluates all chromosomes by calculating a fitness function that includes three parameters: cluster distance, the round in which the last node is drained of its energy, and the round in which the first node is also drained of its energy . The third algorithm is the artificial fish swarm algorithm (AFSA), which is characterized by three fundamental components: There are three more types of behaviors, namely, following behavior, swarming behavior, and search behavior. In a hierarchal organization structure such as AFSA, the individual fish improve their standing by replicating the behavior of the optimal fish. This algorithm is mainly used in IoT networks to determine resource allocation, routing protocol selection, and sensor node placement to enhance the efficiency and performance of IoT networks . The fourth algorithm is energyefficient routing using reinforcement learning (EER-RL), which allows devices to enhance routing choices by sharing localized data within their proximity. We can also notice that this optimization results in choosing the minimum energy links for the next hops. The sender does this by including local data in the packet's header. What can be extracted from this field by any device neighboring the packet consists of device ID, remaining energy, position coordinate, and hop count. EER-RL consists of three main phases: Have been used in network initialization and cluster head selection, cluster formation, and data transmission . The fifth algorithm is the modified low energy adaptive clustering hierarchy (MODLEACH), an enhancement of the earlier published LEACH algorithm intended to reduce IoT device power consumption. It dynamically chooses cluster heads responsible for the communication within clusters so that devices are evenly distributed amongst energy-consuming operations . Enhancing internet of things network efficiency with clustering A (Ahmed Gamal Soliman Soliman Deabe. A ISSN: 2088-8708 The behavioral pattern of a random forest classifier is similar to that of decision trees, but several decision trees pool their results instead of a single decision tree making a prediction. The algorithm computes predictions through a mean of averages to the number of trees created, where prediction accuracy increases with the number of trees created. Unlike a single decision tree algorithm, a random forest addresses limitations such as overfitting, thereby enhancing accuracy. Moreover, it requires minimal package configuration to produce predictions . This paper aims to increase the energy efficiency of IoT networks by using fusion approaches based on the random forest algorithm. Using measures like average end-to-end delay, residual energy per round, and active nodes each round, random forest analyses five algorithms and chooses the best one. This paper's remaining sections are organized as follows: In section 2, the selected cluster head method algorithms for IoT are reviewed together with the pertinent literature. The details of the algorithms under comparison and the fusion method are described in section 3. The algorithms' simulation results, performance analysis, and MATLAB implementation are shown in section 4. In section 5, the conclusion and next steps are presented. LITERATURE REVIEW The LEACH technique in . seeks to improve network coverage while consuming less energy. Clusters have developed inside several areas of each of the networks. The base station determines the distance from the center and residual energy for each round based on each active node's position and remaining energy in each zone. Priority is given to choosing the node with the most significant value to serve as the CH for that area. Using evolutionary algorithms at the base station. Rabah et al. chose the IoT nodes from the group of eligible nodes and designated them as CHs. These assigned CHs are responsible for compiling information from other nodes and sending it to the base station to finish a round. New clusters may form due to the base station reevaluating the IoT nodes' energy levels after each round. To improve cluster head selection in IoT networks. Ouyang et al. used the AFSA, which simulates the foraging, schooling, and following behaviors that fish naturally exhibit. Each artificial fish represents a potential solution, and the algorithm improves these solutions iteratively. The fish search for better positions . , move towards the center of the swarm if it is advantageous . , or follow other fish with superior positions . A fitness function considers factors like residual energy and node Regilan and Hema . introduced energy-efficient routing using a reinforcement learning algorithm to enhance cluster head selection in IoT networks by leveraging reinforcement learning to dynamically allocate node roles according to their energy reserves and network structure. Each node's state is defined by its remaining energy and position, and its actions involve the selection of itself or adjacent nodes as cluster When Iwendi et al. used the random forest technique on a dataset of coronavirus disease (COVID-. patients, they obtained an F1 score of 0. 866, which the AdaBoost approach then enhanced. They found that the Boosted random forest algorithm provides accurate predictions even for unbalanced According to their analysis. Wuhan locals had more excellent death rates than non-natives. Additionally, male patients were more likely to die than female patients, and the majority of those impacted were between the ages of 20 and 70. According to Wang et al. , coastal areas are under tremendous stress due to widespread population movement, land conversion, and environmental changes worldwide. Based on the abovementioned literature analysis, their study used seven random forest-derived variable rating techniques. classification and regression trees (CART) and conditional inference trees (CIT), two decision tree types, were used in the feature reduction processes to select the best classification model. However, the most accurate approach is the conditional permutation variable importance measure (CPVIM) method, which generated reasonably stable and realistic feature ranks from the correlated RS data. Additionally, time characteristics acquired in a single lead of the electrocardiogram (ECG) signal were considered by Saenz-Cogollo and Agelli . , which is why the authors concentrated on the problem of data quality selection of these features. They evaluated the heartbeat classification performance using the created random forest (RF) algorithm. Association for the Advancement of Medical Instrumentation (AAMI) standards, and the inter-patient method. Normalized features proportional to the width of the QRS complex's primary wave and R-R intervals were the classification characteristics with the most significant discriminant They performed best using the 40trees RF classifier and the top six characteristics. The extensive use of remote sensing imagery for land cover categorization and the development of different classification methods in this area were emphasized by Vali et al. Support vector machines Int J Elec & Comp Eng. Vol. No. October 2025: 4954-4964 Int J Elec & Comp Eng ISSN: 2088-8708 (SVM. and random forests are two supervised categorization techniques that have recently become popular in remote sensing applications. The study aimed to evaluate how well the RF classifier and decision tree performed compared to SVMs. With a classification accuracy of up to 86%, the random forest classifier outperformed the decision tree and SVMs in misclassification situations and classification precision, according to preliminary tangible research. This paper presents some integration methods based on the RF algorithm that can help improve the energy efficiency of IoT networks. The paper focuses on identifying the best cluster head technique, followed by implementing and testing the MATLAB code. EXPLANATION OF FUSION TECHNIQUES UTILIZING THE RANDOM FOREST ALGORITHM This section will describe fusion methods that use the radio frequency algorithm. Machine learning achieves artificial intelligence as defined. Among the algorithms is the random forest Algorithm, which is incredibly straightforward but effective. This is essentially a voting tree classifier, in which the algorithm selects the best classification tree to determine the final classification. It is crucial to comprehend the concept of ensemble learning before delving into the specifics of the random forest algorithm's practical application within machine learning. Using many models rather than a single model improves predictive performance through ensemble learning. Such an approach is motivated by the desire to use the diversity of models in the ensemble to enhance generalization and prevent overfitting. The two primary categories of ensemble algorithms are boosting and bagging. Bagging A random forest algorithm works with the help of bootstrapping, in which several training subsets are built, each randomly chosen from the original training set and replaced. In Figure 2, one observes that several models are constructed simultaneously on different sub-samples of data, a unique feature of the random forest algorithm where the final prediction is made based on a majority rule. As for random forest, the ensemble method is bagging or bootstrap aggregation. Here is an explanation of the bagging procedure: Subset selection: specifically, random sampling of complete data is taken. Bootstrap sampling: these subsets, referred to as Bootstrap samples, are used to train the models. The samples are removed from the original data using row sampling with replacement. Bootstrapping: this phase means the row sampling with replacement. The phrase refers to the row sampling with replacement. Independent model training: each model is trained separately on its Bootstrap sample, so the outcomes of the models are different. Majority voting: the most often projected outcome from each model is selected, and all model results are combined to determine the final forecast. Aggregation: based on a majority vote, this last stage integrates all the results to create the final product. Figure 2. The process of bootstrap aggregation Boosting A machine learning approach called "boosting" turns multiple weak learners into one powerful learner, increasing model accuracy. In Figure 3, boosting models are trained independently and sequentially. The boosting algorithm follows these steps: Initialize weights: give every training example the same initial weight. Train a weak learner: train a weak learner using the weighted training data, such as a decision tree with a few levels. A weak learner is a straightforward model that performs marginally better than random guessing. Enhancing internet of things network efficiency with clustering A (Ahmed Gamal Soliman Soliman Deabe. A ISSN: 2088-8708 Calculate error: evaluate the weak learner's error on the training set, considering the weighted sum of misclassified instances. Update weights: modify the weights according to the mistake rate, giving incorrectly classified examples a higher weight and correctly categorized ones a lower weight. Repeat steps 2-4 multiple times, training a new weak learner in each iteration with the updated weights. Combine weak learners: all weak learners trained in the earlier phases make up the final model. Based on their accuracy, each weak learner is given a weight, and the weight forecasts of all weak learners are combined to create the final prediction. Predict: use the completed model to predict class labels for new instances. Figure 3. The process of boosting Random forset algorithm During training, the random forest algorithm creates several decision trees. From these trees, it determines the mean prediction . or regressio. or the mode of the classes . or classificatio. It builds an ensemble of trees using a method called bagging . ootstrap aggregatin. A random portion of the training data and a random subset of the characteristics are used to train each tree. The trees' diversity and randomization reduce overfitting and improve the model's capacity for generalization. Each tree individually assigns a class label during the prediction phase, and the class with the most votes . is used to make the final prediction. The random forest classifier comprises a group of classifiers with a tree topology. The random vector used to create each tree is separately distributed from earlier random vectors with the same When given an input x, the trees cast their votes for the most popular class. Two parameters, accuracy and the interdependence of individual classifiersAiare used to determine an upper bound for the generalization error of random forests. Figure 4 shows the random forest algorithm's flowchart. Figure 4. Random forest flow chart To produce a more reliable and accurate model, ensemble techniques in machine learning aggregate predictions from several models. The fundamental idea is to improve the overall accuracy and resilience of the forecast by combining the predictions of different models to eliminate errors. Figure 5 shows the random forest algorithm in action. Decision trees and ensemble learning are used in the random forest algorithm. The steps can be used to describe how it works: Int J Elec & Comp Eng. Vol. No. October 2025: 4954-4964 Int J Elec & Comp Eng ISSN: 2088-8708 Step 1: Choose samples at random from the dataset or training set. Step 2: Create a decision tree for every sample that was chosen. Step 3: Use a voting procedure by averaging the decisions of each decision tree. Step 4: Choose the prediction with the highest number of votes as the final prediction. Random forest creates multiple training sets to enhance the diversity among classification models and, thus, the extrapolative predictive capability of the combined models. After k training iterations, a set of classification models {Ea1 . cU). Ea2 . cU). A . Eaya . cU) is obtained. A simple majority voting procedure decides the system's ultimate classification outcome. The decision formula is presented in . = ycaycyci ycoycaycu Ocya ycn=1 ya(Eaycn . = ycU) . where ycU is the output variable . , classification labe. , ya is the indicator function, ya is the random forest model, ycu is the test sample, and Eaycn is a single decision tree. Figure 5. The random forest algorithm's operation PERFORMANCE EVALUATION The random forest algorithm simulation results for fusion techniques are shown in this section. The number of live nodes, latency, and residual energy were the three main results of the experiment. The simulation environment is described in the first section, and then the simulation results are thoroughly Simulation environment The performance of fusion techniques utilizing the random forest algorithm is assessed and evaluated using the MATLAB simulator. The key parameters for the evaluation are presented in Table 1. The experiment involves four variables: the number of nodes, initial energy, number of clusters, and network radius, with one variable changed while the others remained constant. A comprehensive set of sixty experiments was conducted, producing three outputs for each experiment: the number of live nodes, delay, and residual energy. The simulations were performed over 900 rounds, with the BS located at the center of the grid. The packet size is set at 1024 bytes to match the faster transmission rate of IoT nodes. The network is configured in a circular layout with radii ranging from 200 m to 600 m, comprising 100 to 500 IoT nodes. Initial energy levels (E. range from 0. 5 J to 2. 5 J. The number of clusters (No = py. , where n represents the number of nodes and p is set between 0. 03 to 0. 07, representing a percentage of the total network nodes in Table 2 will present specifications for four cases selected from the sixty experiments. Table 1. Simulation configuration Parameters Size of a data packet yayceyc yayceycoyceyca yaycoycy yayaya Distance threshold . ccycu ) Values 1024 byte 10 ycE ya/ycaycnyc/yco 50 nJ/bit 0013 ycE ya/yca/yco 5 nJ/b/message yuAyceyc yco Oo yuAycoycy Enhancing internet of things network efficiency with clustering A (Ahmed Gamal Soliman Soliman Deabe. A ISSN: 2088-8708 Table 2. Presents specifications for four cases Cases Radius No. of Nodes Eo=0. Eo=1J Eo=1. Eo=0. Experimental results The metrics are explained in the following sections: remaining energy is the amount of energy in the network after one serving, lifetime is the amount of time the network stays active after one serving, live nodes are the number of nodes that are currently active in the network, and delay is the average end-to-end latency for one serving. Alive nodes Figures 6, 7, 8, and 9 show the number of active sensor nodes every round for four circumstances. These figures reveal that while the AFSA algorithm showcases superior energy efficiency, the GA algorithm surpasses it in specific contexts. Conversely, the LEACH. EER-RL, and MODLEACH algorithms exhibit higher energy consumption. Specifically, the last node in the AFSA algorithm dies after 900 rounds, compared to 800 rounds in the GA algorithm. Meanwhile, the previous nodes in the EER-RL and MODLEACH algorithms die after 700 rounds, and the LEACH algorithm's last node dies after 600 rounds. Fusion techniques are employed using the random forest algorithm to determine the optimum algorithm. Figure 6. shows how many nodes remain viable for fusion techniques in the first case Figure 7. shows how many nodes remain viable for fusion techniques in the second case Figure 8. shows the number of nodes alive for fusion techniques in the third case Figure 9. shows the number of nodes alive for fusion techniques in the fourth case Int J Elec & Comp Eng. Vol. No. October 2025: 4954-4964 Int J Elec & Comp Eng ISSN: 2088-8708 Residual energy Figures 10, 11, 12, and 13 display the total remaining energy per round across four scenarios. Although the AFSA algorithm is typically more energy-efficient, the GA algorithm outperforms it in certain Fusion techniques are utilized with the random forest algorithm to identify the optimal algorithm. The goal of choosing Cluster Heads is to improve performance by considering variables like distance, residual energy. IoT node degree, and cluster uniformity. In contrast, the LEACH. EER-RL, and MODLEACH algorithms consume substantial energy during operation, resulting in the least remaining energy after 900 rounds. Figure 10. Shows the total energy left over for fusion methods in the first case Figure 11. Shows the total energy left over for fusion methods in the second case Figure 12. Shows the total energy left over for fusion methods in the third case Figure 13. Shows the total energy left over for fusion methods in the fourth case Delay Transmission delay is used to evaluate network performance. Figures 14, 15, 16, and 17 compare five algorithms based on average end-to-end latency. Although the AFSA algorithm generally performs better, the GA algorithm excels in specific scenarios. Fusion techniques, implemented through the random forest algorithm, are used to identify the most effective algorithm. The algorithm introduces a delay due to the re-selection of optimal Cluster Head nodes based on specific criteria. However, significant performance differences are observed among the LEACH. EER-RL, and MODLEACH algorithms. Enhancing internet of things network efficiency with clustering A (Ahmed Gamal Soliman Soliman Deabe. A Figure 14. Delay vs. rounds for fusion techniques in the first case ISSN: 2088-8708 Figure 15. Delay vs. rounds for fusion techniques in the second case CONCLUSION AND FUTURE WORKS The IoT is a pivotal element of the future internet, enabling efficient data collection and transfer. However, energy consumption in IoT networks poses a significant challenge. Innovations in IoT are rapidly advancing, particularly in optimizing energy usage and extending network lifespan. Clustering is essential for reducing power consumption, enhancing data accuracy, and prolonging network longevity when gathering IoT data. IoT nodes are grouped into clusters using this technique, and communication within and between clusters is made easier by CH overseeing CM. Many algorithms seek to extend battery life, boost network longevity, and increase the number of active nodes. These algorithms employ optimization and clustering techniques to enhance performance and energy efficiency. The AFSA algorithm has proven to be the most efficient, though the GA algorithm excels in specific scenarios. Fusion techniques are applied using the random forest algorithm to determine the most efficient approach. Future work in IoT energy efficiency and network longevity will focus on developing dynamic clustering techniques that can adapt to changing network conditions in real-time. This could further optimize energy usage and data aggregation in IoT networks, improving overall performance and efficiency. Additionally, integrating energy harvesting technologies could be explored to supplement or replace battery power in IoT devices, extending their operational lifespan and reducing environmental impact. REFERENCES