## 6 Proposed Algorithms
### Deep Neural Network-Based Tuning Algorithm
#### 6.2.2 The Tuning Algorithm  
Since the IS algorithm mainly depends on the achievable throughput to select the interface combination of the receiving nodes, the Tuning algorithm tries to tune or ensure this selection. This is done mainly for the nodes where the achievable throughput of both of their interfaces are slightly different (within 10%). Using the trained DNN and the available information about the achievable throughput of the interfaces of each node, the algorithm calculates the overall network energy consumption based on the outcome of the IS algorithm. After this, the Tuning algorithm revisits the nodes where both interfaces are selected and tries to tune this selection; it then checks the resultant energy consumption using the DNN. The outcome after tuning will only be selected if it achieves lower energy consumption than the outcome of the IS algorithm.  
It is worth noting that the Tuning algorithm runs in the SDN controller. It depends on a pre-trained model trained offline on a dataset with measured values that relates the throughput values of the utilized interfaces to the total energy consumption of a user device. Thus, the training time is not included in the operation of the algorithm. Moreover, the DNN training and the algorithm execution do not contribute to the energy consumption of the receiving nodes under study. In addition, the controller is not battery-powered and is supposed to be run by the network provider.  
The SDN controller executes the algorithm first by calculating the energy consumption of all nodes from the pre-trained DNN model after starting the transmission using the selected interfaces by the IS algorithm. Next, it simply alters the outcome of the IS algorithm only if both interfaces are selected for a node and uses only the faster interface. After this, it remeasures the throughput values and recalculates the tuned energy consumption for all the nodes using the pre-trained DNN model; it then compares the tuned overall consumption  
Figure 8: Neural network model.  
with the overall consumption from the IS algorithm. This makes the complexity of the Tuning algorithm O(n) of the controller processing time needed to calculate the energy consumption of each node using the pre-trained DNN model, where \(n\) is the number of nodes under the overlapped coverage of an LTE/5G cell and a WiFi AP.  
Figure 9 explains the Tuning algorithm in detail.  
The following steps compose the Tuning algorithm.  
* Step 1: Train the DNN (an offline step).
* Step 2: Feed the output of the IS algorithm for all network nodes to the trained DNN.
* Step 3: Calculate the sum of the energy consumption of all network nodes using the trained DNN based on the measured throughput values.
* Step 4: For the nodes with both interfaces selected by the IS algorithm, select only the interface with the highest achievable throughput.
* Step 5: Measure the throughput by the SDN controller based on the newly tuned selection and feed it to the DNN.
* Step 6: Obtain the energy values of all nodes from the DNN.
* Step 7: Compare the energy values from Step 3 and Step 6; if the energy sum after tuning is greater, use the interfaces as chosen by the IS algorithm for the data transfer. Otherwise, use the interfaces as chosen by the Tuning algorithm.