# Multimodal Power Management Based on Decision Tree for Internet of Wearable Things Systems
## 3 Intelligent Power Management
### ML-Decision Tree  
Machine learning (ML) is an attractive method for the intelligent management of energy utilization in IoWT systems. Different ML approaches can be used, such as genetic algorithms and neural networks, among others. As [PERSON] and [PERSON] [28] pointed out, ML-decision trees can be designed with low computational overhead, as they rely on recursive data partitions of the dataset by comparing features with a threshold. This proposal suggests using a low-power decision tree algorithm to efficiently manage energy consumption. ML-decision trees perform simple evaluations (comparisons) on the available features to form homogeneous subsets based on decision rules. Each level of the tree represents a refinement of the subset that guides to a final decision, in this case, the sleep period. The fit algorithm computes decision rules to split the dataset (features and corresponding threshold) once the decision tree is trained. As a result, in the proposed model, an ensemble of four trees (one for each feature) with a depth of \(k\) (i.e., \(2k-1\) nodes), the total number of operations required for inference is \(4\times k\) plus the decision.  
In this proposal, the multimodal ML-based decision tree estimates the duration of the sensor node's sleep period \(\hat{T}_{Sleep}\) according to the data acquisition statistics (Temp, HR, SpO2), and supercapacitor voltage level (\(V_{scap}\)).  
ML policies are implemented on the power management approach providing better insight and understanding of the discrete actions taken by the PPG-based IoWT system. The policies follow the National Early Warning System (NEWS) [35], and the control flow is addressed by the Decision tree algorithm to maximize the number of transmitted packets considering the level of available energy.  
A state vector \(\zeta_{i}=(T_{i},SpO2_{i},HR_{i},V_{scap},T_{sleep})\) is established describing the state of the PPG-based IoWT system. In this regard, for every measurement of the variables, the ML algorithm establishes the split actions following the NEWS statements and estimates the best \(\hat{T}_{sleep}\) period. The decision tree algorithm selects the weights associated with each \(\zeta_{i}\), and the thresholds \(\beta_{Th}\).  
The algorithm comprises three main steps:  
* The initial information entropy of the sample set \(H(\zeta)\) is calculated as \[H(\zeta)=-\sum_{i=1}^{m}p\dot{i}_{i}\log_{2}p\dot{i}_{i}.\] (1) where \(\zeta\) is the sample set, \(pi_{i}\) represents the probability of samples, and \(m\) is the number of classes, which matches the sleep system periods.  
* The split entropy of the sample set under a selected action is calculated assuming that \(\zeta\) is divided into two subsets \(\{\zeta_{L},\zeta_{R}\}\) by a randomly selected action \(A\). The split entropy is shown as follows: \[H_{A}(\zeta)=\frac{|\zeta_{L}|}{|\zeta|}H(\zeta_{L})+\frac{|\zeta_{R}|}{|\zeta|}H (\zeta_{R}).\] (2)
* The information gain is computed by subtracting (2) from (1), \[Gain(A)=H(\zeta)-H_{A}(\zeta)\] (3)  
Finally, the decision tree algorithm is trained to fit the state-action data through supervised learning using Matlab's statistics and machine learning toolbox. An amount of 4000 samples of HR, Temp, SpO2, and Vscap were used for training based on the NEWS standard. Data were divided into training and test sets.