# Visual Data and Pattern Analysis for Smart Education:
## 4 Proposed Methods
### Federated Learning-Based Authentication
For \(\delta_{1}\) (SS to CIs like) and its reverse:  
\[\mathcal{L}_{cycle\ \delta_{1}}=\left|\left.\delta_{1}(\delta_{2}(\alpha))- \alpha\right)\right|_{1} \tag{5}\]  
For \(\delta_{2}\) (CIs to SS like) and its reverse:  
\[\mathcal{L}_{cycle\ \delta_{2}}=\left|\left.\delta_{2}(\delta_{1}(\beta))- \beta\right)\right|_{1} \tag{6}\]  
Here, \(\mathcal{L}_{identity}\) encourages generated features to resemble the original, while \(\mathcal{L}_{cycle}\) ensures cycle consistency. Equation (7) represents the generator loss (\(\mathcal{L}_{\delta}\)). \[\mathcal{L}_{\delta}=\mathcal{L}_{identity}(\delta_{1})+\mathcal{L}_{identity }(\delta_{2})+\mathcal{L}_{cycle}(\delta_{1}(\delta_{2}))+\mathcal{L}_{ cycle}(\delta_{2}(\delta_{1})) \tag{7}\]  
Here, \(\mathcal{L}_{real}\) encourages the discriminator to correctly identify real features, while \(\mathcal{L}_{fake}\) encourages the discriminator to accurately identify generated features as fake. Equation (8) represents the discriminator loss (\(\mathcal{L}_{\varepsilon}\)). \[\mathcal{L}_{\varepsilon}=\mathcal{L}_{real}(\epsilon_{1})+\mathcal{L}_{fake} (\epsilon_{1}(\delta_{1}))+\mathcal{L}_{real}(\epsilon_{2})+\mathcal{L}_{fake} (\epsilon_{2}(\delta_{2})) \tag{8}\]  
The process for implementing the Cycle Generative Adversarial Network (CGAN) is detailed in Pseudocode 1. This pseudocode outlines the steps for optimising the generator and discriminator networks over multiple epochs. ```
Input:\(num_{epochs}\), \(data_{loader}\), \(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\) for epoch in range for batch in \(data_{loader}\) for epoch in range  Optimise \(\epsilon(\epsilon_{1}\), \(\epsilon_{2}\), \(\delta_{1}\), \(\delta_{2}\), batch) for epoch in range  Optimise \(\delta(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\), batch) update network weights \((\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2})\) Output: Trained \(\delta(\delta_{1}\),\(\delta_{2})\), Trained \(\epsilon(\epsilon_{1}\), \(\epsilon_{2})\)
```  
**Pseudocode 1: CGAN Implementation**  
```
Input:\(num_{epochs}\), \(data_{loader}\), \(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\) for epoch in range for epoch in range  Optimise \(\epsilon(\epsilon_{1}\), \(\epsilon_{2}\), \(\delta_{1}\), \(\delta_{2}\), batch) for epoch in range  Optimise \(\delta(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\), batch) update network weights \((\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2})\) Output: Trained \(\delta(\delta_{1}\),\(\delta_{2})\), Trained \(\epsilon(\epsilon_{1}\), \(\epsilon_{2})\)
```  
**Pseudocode 2: CGAN implementation**  
``` Input:\(num_{epochs}\), \(data_{loader}\), \(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\) for epoch in range for epoch in range for batch in \(data_{loader}\) for epoch in range  Optimise \(\epsilon(\epsilon_{1}\), \(\epsilon_{2}\), \(\delta_{1}\), \(\delta_{2}\), batch) for epoch in range  Optimise \(\delta(\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2}\), batch) update network weights \((\delta_{1}\), \(\delta_{2}\), \(\epsilon_{1}\), \(\epsilon_{2})\) Output: Trained \(\deltaThe generated global models are shared with the students and CIs for authentication purposes. It is important to note that the CI models and student models are swapped between sub-servers to ensure a secure and private environment. By utilising these trained models, issues commonly associated with conventional authentication methods, such as sniffing, spoofing, and shoulder surfing attacks, can be effectively mitigated through the proposed, federated learning-based authentication approach. ### Majority Voting-Based Multi-Objective Student Engagement Clustering

Only authenticated students and course instructors (CIs) are permitted to participate in the adaptive e-learning course.