## 5 Results  
This study is motivated by the recognition of event patterns that may occur in nature. TFNN is designed as a robust algorithm that autonomously adapts to the diverse dynamics of IoT networks without human intervention, while enhancing the network's longevity in recognizing event patterns. This study focuses on exploring the energy consumption and accuracy of the TFNN algorithm. The Modified National Institute of Standards and Technology (MNIST) digit dataset was utilized, where each IoT device in the network is trained on a selection of training patterns from this dataset [59]. The MNIST dataset consists of a large collection of handwritten digits ranging from 0 to 9 and is categorized into two main subsets: training and test sets. A sample of handwritten digits is shown in Figure 1. In this simulation, the training dataset is partitioned, with each IoT device receiving equal number of random, non-overlapping set of training patterns corresponding to the selected digit. During the simulation, test patterns are randomly selected from the MNIST test set, and the same pattern is presented to all IoT nodes in each test epoch (round). TFNN is simulated using MATLAB, and its performance is compared to a scenario where any node in the network communicates its local results directly to the base-station [60]. The simulation utilizes the LEACH algorithm, which organizes the network topology by selecting cluster heads and forming clusters, while each active node implements the kNN algorithm to recognize event patterns locally. Additionally, the simulation considers communication performance, allowing active nodes within a cluster to communicate directly with their cluster head, while nodes that fail to join any cluster can communicate directly with the base-station. Each cluster head aggregates the local kNN results from its members using majority voting; thus, cluster members are not permitted to communicate directly with the base-station. Subsequently, each cluster head relays its winning pattern class label to the base-station. At the base-station, a second round of majority voting is performed, where the collected class labels from active nodes not belonging to any cluster, along with those from the cluster heads, are aggregated to determine the final winning class label for the event pattern. The simulation assumes a field size of 100 m \(\times\) 100 m, with the base-station located outside the field at coordinates (50, 200). The base-station is positioned significantly far from the network to amplify the impact of communication to the base-station in this simulation setup. Other nodes are deployed randomly, as illustrated in Figure 2. The number of IoT nodes deployed can be adjusted to simulate networks of varying sizes, specifically utilizing two configurations in this study: 50 and 100 nodes. In the case of a network of 50 IoT nodes, depicted in Figure 2, the setup includes the base-station and 50 IoT nodes organized into clusters of varying sizes. In each round, the clusters are re-created according to the LEACH algorithm, resulting in a different number of clusters of various sizes in each round. As previously mentioned, communication energy is the primary consumer of energy resources for IoT nodes. This energy consumption is primarily associated with waiting to receive messages, waiting for a node's turn to communicate with the destination, and the energy cost of transmitting messages. Two key factors significantly influence communication energy: the number of communicated bits and the distance from the node to the destination. These factors are incorporated into the simulation to evaluate performance. In the simulation, the base-station is assumed to be connected to a continuous energy source, while all other nodes and cluster heads are equipped with equal amounts of energy, utilizing the same type of battery. In each round, the energy consumption of each node is calculated, and each node ceases to operate once its energy is depleted.