## 3 System Models
### Network Model  
In the network model, we assume the realistic deployment of different healthcare application-aware IoT devices, in which LC devices directly communicate with the healthcare cloud/server. Every LC acts as an intermediate bridge for a few end-devices called ILCs. Figure 1 shows the general network settings, in which the network configurations are flexible according to the network requirements. The deployed devices are based on modern IoT infrastructure that can run local learning models over the rich data generated by the healthcare applications of individual devices. We assume the deployment of \(L=i:i=1,2,.....L\) IoT smart healthcare devices of intra-local clients (ILCs), which communicate with the global healthcare server with the help of \(M=j:j=1,2,.....M\) intermediate local clients (LCs). \(M_{j}\) aggregates the updates from a particular associated set of \(L_{i}\) devices and uploads them to the cloud server, denoted as \(G\). In a particular network communication round \(R\), only \(L_{i}\subseteq L\) online ILC devices actively participate in the hierarchical FL process. Each ILC and LC device contains its own dataset to train the local data models, represented as \(S_{i}=(x_{k},y_{k})_{k=1}^{|S_{i}|}\) and \(S_{j}=(x_{k},y_{k})_{k=1}^{|S_{j}|}\), respectively. Here, \(x_{k}\) represents the \(k-th\) input sample, and \(y_{k}\) is the corresponding labeled output of \(x_{k}\) of the hierarchical FL. In the proposed hierarchical FL (HeirFL) model, all clients are static and remain active throughout the learning and aggregation processes. The network nodes share the learning parameters to support two-level aggregation, first at the intermediate CL devices and then at the cloud server. To measure the computational cost of the proposed model, the formulation of the energy and delay overhead is vital for cloud server aggregation. Based on the aforementioned FL model for the stepwise learning process, the model computation of the ILC devices is the first step to be considered. An active \(L_{i}\) ILC device computes the machine-learning model parameters \(\omega\), which classify each output value \(y_{k}\) for the input \(x_{k}\) of the dataset \(S_{i}=(x_{k},y_{k})_{k=1}^{|S_{i}|}\). The loss function on \(S_{i}=(x_{k},y_{k})_{k=1}^{|S_{i}|}\) of the \(L_{i}\) device is computed as  
\[F_{i}(\omega)S_{i}=\frac{1}{|S_{i}|}\sum_{K=1}^{S_{i}}f_{i}(x_{k},y_{k},\omega). \tag{1}\]  
To compute the ILC model accuracy \(\Theta e(0,1)\), the ILC device \(L_{i}\) runs for a wide range of iterative algorithms according to the following local iterations:  
\[Q(\Theta)=\mu\log(\frac{1}{\Theta}). \tag{2}\]  
Furthermore, the data size \(S_{i}\) and machine-learning tasks affect the value of \(\mu\). \(L_{i}\) computes the local update at the \(c-th\) iteration as  
\[\omega_{i}^{c}=\omega_{i}^{c}-\eta\bigtriangledown F_{i}(\omega_{i}^{c-1}). \tag{3}\]  
This learning process continues until the following computational results are obtained:  
\[\|\bigtriangledown F_{i}(\omega_{i}^{c})\|\leq\Theta\Big{\|}\bigtriangledown F _{i}(\omega_{i}^{c-1})\Big{\|}, \tag{4}\]  
where \(\eta\) denotes a predefined learning rate. The number of required CPU cycles to process a single data sample of the device \(L_{i}\) is defined as \(D_{i}\). Similarly, the total number of CPU cycles is calculated as \(D_{i}|S_{i}|\). Thus, the total delay can be computed as  
\[t_{i}^{empt-time}=Q(\Theta)\frac{D_{i}|S_{i}|}{f_{n}}. \tag{5}\]  
Figure 1: The proposed secure hierarchical federated learning (SHFL) architecture. A realistic deployment of different healthcare application-aware IoT devices is assumed, in which the LC devices directly communicate with the healthcare cloud/server. All the assumed devices are based on modern IoT infrastructure that can run local learning models over the rich data generated by the healthcare applications.