## 3 Methodology
### Ontology-Integrated Federated Unlearning (OFU-Ontology) Algorithm
#### 3.2.3 Workflow of OFU-Ontology  
1. Training Phase: During the training phase, an individual federated node n carries out local model training using gradient descent for every single data point \(d_{i}\) from its local dataset \(D^{n}\). For its local data point observations, the node computes the gradient of the loss function \(L\) with respect to the model parameters \(\theta^{n}\):  
\[\Delta\theta_{d_{i}}^{n}=\
abla_{\theta^{n}}L(d_{i},\theta^{n}) \tag{7}\]  
Here, \(\Delta\theta_{d_{i}}^{n}\) is stored for potential use in the unlearning phase. The local model parameters are updated using gradient descent:  
\[\theta^{n}=\theta^{n}-\eta\cdot\Delta\theta_{d_{i}}^{n} \tag{8}\]  
where \(\theta^{n}\) local model parameters at node \(n\) and \(\eta\) is the learning rate. 2. Ontology and Relevance Score Calculation: The ontology is first utilized during the relevance score calculation. Each node has access to the ontology module, which defines relationships and importance levels for different data entities. This phase is essential for determining how important each data point is in relation to the entire dataset. The ontology function \(f_{ontology}\) calculates the relevance score \(R(d_{i})\) for each data point \(d_{i}\):  
\[R(d_{i})=f_{ontology}(d_{i}) \tag{9}\]  
Here, \(f_{ontology}\) uses the domain-specific ontology to assess relationships, attributes, and the importance hierarchy of the data point. The code editor uses a relevance score ranging from 0 to 1 to comprehend which points play a very vital role in the model's performance and can be unlearned with little to no impact. 3. Selective Unlearning Phase: This selective unlearning phase begins by creating an unlearning request. Here, ontology plays an important role in determining how large an unlearning should be made to each respective data point's influence. The node now checks the relevance score of the data point requested for unlearning: if \(R(d_{i})<R_{threshold}\), then data point d_i gets the priority. A lower relevance score implies that the data point has less impact on the model and therefore can be removed more easily. To remove the influence of the data point, the node applies the negative gradient, weighted by its relevance score:  
\[\theta^{n}_{updated}=\theta^{n}-\eta\cdot(1-R(d_{i}))\cdot\Delta\theta^{n}_{d_ {i}} \tag{10}\]  
where \(\theta^{n}\) is the model parameters at node \(n\), \(\eta\) is the learning rate, \(\Delta\theta^{n}_{d_{i}}\) is the gradient update for data point \(d_{i}\), and \((1-R(d_{i}))\) ensures that the impact of unlearning is proportional to the relevance score. Data points with lower relevance scores have a larger adjustment, effectively removing their influence more aggressively. 4. Decoupling Knowledge Permeation: In another indirect way, the ontology does help mitigate knowledge permeation (i.e., the spread of influence from unlearnt data to other nodes via the aggregated global model). After unlearning, the node applies a decoupling update to further minimize residual effects \(\Delta\theta^{n}_{decoupled}=\Delta\theta^{n}_{d_{i}}\cdot(1-R(d_{i}))\) This ensures that the influence of unlearned data is not only minimized locally but also reduced when the global model is aggregated. 5. Global Aggregation Phase: Each node has finished its selective unlearning; the resulting models are sent to the central coordinating server. The central server then aggregates these model updates into a global model. The central server aggregates models updated at nodes as follows:  
\[\theta_{G}=\sum_{n-1}^{N}\frac{\mid D^{n}\mid}{\mid D\mid}\cdot\theta^{n}_{ update} \tag{11}\]  
where \(\mid D^{n}\mid\) is the number of data points at node nnn and \(\mid D\mid\) is the total number of data points across all nodes. The ontology indirectly influences this phase by ensuring that only less relevant data points are aggressively unlearned, thereby reducing the negative impact on the aggregated model. 6.