## 4 Evaluation
### Energy Consumption  
Energy consumption is the most significant constraint in IoT networks, directly affecting both operational efficiency and network longevity. In particular, communication processes are the largest consumers of energy. The TFNN approach enhances the lifespan of the network by incorporating energy-efficient techniques from the LEACH protocol. Organizing the network into clusters with designated cluster heads and randomizing their selection, energy consumption is balanced across all nodes. Moreover, processing raw data at the local node level and aggregating results at the cluster level reduce the amount of data communicated to the base-station. It is important to consider that the topology and placement of IoT nodes, as well as their distance from the base-station, significantly influence energy usage for data transmission. In TFNN, the locally processed sensory data are analyzed using kNN at the node level, after which each cluster head collects and aggregates the class label results from the associated IoT nodes before forwarding them to the base-station. Therefore, the energy consumption related to data communication can be understood by taking into consideration two key aspects, transmission of data (\(E_{Tx}\)) and receiving data (\(E_{Rx}\)), as in the following formulas:  
\[E_{Tx}(m,d)=(E_{elec}*m)+(\epsilon_{amp}*m*d^{2}) \tag{3}\]  
\[E_{Rx}(m)=E_{elce}*m \tag{4}\]  
where \(E_{elce}\) represents the energy dissipation in Joules (\(J\)) per bit (\(b\)) required to operate the wireless transmitter circuitry, typically consuming 50 nJ/b. Additionally, the energy consumed by the transmitter amplifier generally consumes 100 pJ/m\({}^{2}\) during the receiving waiting period, which is required to achieve an acceptable \(\frac{E_{b}}{N_{q}}\) ratio. To transmit \(m\)-bitsmessage over a distance \(d\), we can use Formula (3). Moreover, Formula (4) illustrates that receiving messages incurs non-negligible energy costs.  
The cost of communication is significantly influenced not only by the distance between nodes but also by the size (number of bits per message (\(m\))) and the total number of transmitted messages. The clustering achieved by the LEACH protocol helps minimize the number of messages sent directly to the base-station, as it restricts direct communication to cluster heads only. Consequently, the total energy consumed for communication from the network to the base-station, as represented in Formula (3), can be expressed as \(\sum_{n=1}^{CH}E_{Tx}(m_{n},d_{n})\). Additionally, the clustering algorithm depends on the proximity of nodes to each other, and as a result, the majority of the communications will occur within clusters with small distances (\(d\)), which will consequently affect the overall energy \(E_{Tx}\) calculated by Formula (3). Each cluster head will need to wait and listen for \(n\) node transmissions, and each node will consume communication energy when sending its local result to the cluster head. Therefore, the energy consumption of \(cluster_{i}\) is affected by the number of nodes associated with each cluster and derived from Formulas (3) and (4) as follows:  
\[E_{Rx_{-}cluster_{i}}=n_{cluster_{i}}*E_{dec}*m \tag{5}\]  
\[E_{tx_{-}cluster_{i}}(m,d)=\sum_{i=1}^{n\in cluster_{i}}((E_{de}*m)+( \epsilon*m*d_{i}^{2})) \tag{6}\]  
The waiting energy for the \(i^{th}\) cluster head refers to the time required for \(n\) nodes in cluster \(i\) to transmit their messages to the cluster head. In Formula (6), we assume that each node sends messages of the same size \(m\), and that the distance between the cluster head and the \(i^{th}\) node is denoted as \(d_{i}\).