## 4 Proposed Framework
### Operational Design and Complexity Analysis  
Algorithm 2 presents the functional design of the suggested EdgeGuard framework. The four main parts of the EdgeGuard algorithm--model update distribution, adaptive aggregation, blockchain operations, and edge device computations--determine how long it takes to run. Edge device computations including local model training and data preparation have temporal complexity \(O(I\times n)\), where \(n\) is the local dataset's data point count and \(I\) is the number of training iterations. Using a temporal complexity of \(O(M\times 2^{d})\), where \(M\) is the number of blocks and \(d\) is the PoW difficulty level, the blockchain layer generates and verifies secure blocks using the proof of work (PoW) consensus technique. With \(ed\) denoting the number of edge devices and \(N\) denoting the overall number of model parameters, the adaptive aggregation processes of the central server introduce a complexity of \(O(N\times ed)\).  
This process aggregates updates from every edge device involved in participating. Moreover, the methods of quality assessment and dependability evaluation add a complexity of \(O(ed\times K)\), where \(K\) is the count of evaluation criteria. As such, the entire time complexity of the EdgeGuard approach could be estimated as follows:  
\[O(I\times n)+O(M\times 2^{d})+O(N\times ed)+O(E\times K) \tag{41}\]There is a balance between safe blockchain operations, local computations, and flexible global aggregation in the IoMT setting. This complexity analysis shows how EdgeGuard is spread out.  
```
1:Set of edge devices \(\mathcal{E}=\{ed_{1},ed_{2},\dots,ed_{N}\}\), local datasets \(\mathcal{D}=\{D_{1},D_{2},\dots,D_{N}\}\), global model \(w_{g}\), blockchain \(\mathcal{B}=(B,T,\sigma,V)\), central server \(\mathcal{C}\)
2:Updated global model \(w_{g}\), secure and private federated learning
3:Initialize \(w_{g}\), \(\mathcal{B}\)
4:for each communication round \(t\)do
5:\(\mathcal{E}_{t}\leftarrow\) Select participating devices
6:for each \(e_{i}\in\mathcal{E}_{t}\) in parallel do
7: Preprocess local data \(D_{i}\)
8:\(w_{i}^{t}\leftarrow\) Train local model on \(D_{i}\)
9:\(q_{i}^{t}\leftarrow\)\(\mathcal{Q}(D_{i})\)\(\triangleright\) Quality Assessment
10:\(r_{i}^{t}\gets R(e_{i},t)\)\(\triangleright\) Reliability Evaluation
11:\(\widehat{w}_{i}^{t}\leftarrow w_{i}^{t}+\mathcal{N}(0,\sigma^{2})\)\(\triangleright\) Apply differential privacy
12:\(b_{k}\leftarrow\sigma(b_{k-1}\parallel T(\widehat{w}_{i}^{t},q_{i}^{t},r_{i}^{t}))\)\(\triangleright\) Create blockchain block
13:while\(H(b_{k})\geq\) Target do
14: Adjust nonce in \(b_{k}\)
15:endwhile
16: Broadcast \(b_{k}\) to other miners
17:endfor
18:\(\mathcal{C}\) retrieves \(\{\widehat{w}_{i}^{t},q_{i}^{t},r_{i}^{t}\}_{i\in\mathcal{E}_{t}}\) from \(\mathcal{B}\)
19:\(w_{g}^{t+1}\gets f(\{\widehat{w}_{i}^{t}\}_{i\in\mathcal{E}_{t}},\{q_{i}^ {t}\}_{i\in\mathcal{E}_{t}},\{r_{i}^{t}\}_{i\in\mathcal{E}_{t}})\)\(\triangleright\) Adaptive aggregation
20:\(b_{k+1}\leftarrow\sigma(b_{k}\parallel T(w_{g}^{t+1}))\)\(\triangleright\) Record global update in blockchain
21:for each \(e_{i}\in\mathcal{E}\)do
22:\(e_{i}\) retrieves \(w_{g}^{t+1}\) from \(\mathcal{B}\)
23:\(w_{i}^{t+1}\gets w_{g}^{t+1}\)\(\triangleright\) Update local model
24:endfor
25:if convergence criteria met then
26:break
27:endif
28:endfor
29:return\(w_{g}\)
```  
**Algorithm 2** EdgeGuard: secure federated learning for IoMT.