Federated Learning-Based Concept Drift
Detection with XAI
COURSE CODE: CSE-4872
COURSE TITLE: Neural Network and Fuzzy System Lab
SUBMITTED TO:
Abu Monsur Mohammad Fahim
Adjunct Faculty, Dept of CSE, IIUC
SUBMITTED BY:
Name: Mohammad Arman Hossain
ID NO: C221104
SEMESTER: 8th
SECTION: 8CM
DEPARTMENT: CSE Remarks
SUBMISSION DATE: 06-10-2025
1. Objective
The objective of this experiment is to design and implement a federated learning (FL)
framework for detecting concept drift in IoT sensor data using multiple datasets (Fridge,
MotionLight, Thermostat, and UrbanSound8K metadata).
The model incorporates Explainable AI (XAI) techniques such as SHAP and LIME to
interpret model predictions and understand feature influence.
2. Datasets Used
1. IoT Fridge Dataset – Contains temperature and humidity sensor readings.
2. IoT MotionLight Dataset – Includes light intensity and motion sensor activity logs.
3. IoT Thermostat Dataset – Records room temperature, target temperature, and
HVAC activity.
4. UrbanSound8K (metadata) – Provides non-IoT audio metadata for ambient noise
simulation in drift scenarios.
Each dataset simulates a federated client, representing a different IoT device domain
contributing to the global drift model.
3. Pseudo-Algorithm: Federated Drift Detection + Explainable Fusion
Input: Datasets D1...D4 from IoT devices
Output: Global drift detector with explainable outputs
Step 1: Data Loading and Preprocessing
- Import D1...D4 (Fridge, MotionLight, Thermostat, UrbanSound8K)
- Clean missing values (dropna or impute)
- Normalize or scale features
Step 2: Federated Client Simulation
- Split each dataset into non-IID partitions
- For each client i:
• Train a local anomaly model using IsolationForest
• Collect local drift scores
Step 3: Global Model Fusion
- Concatenate all local representations
- Train a fusion model (RandomForestClassifier)
- Label high-drift samples as anomalies (synthetic drift_detected labels)
Step 4: Explainability Integration
- Apply SHAP to visualize global feature importance
- Apply LIME to explain instance-level predictions
Step 5: Evaluation
- Compute Accuracy, Precision, Recall, F1, AUC
- Generate Confusion Matrix
- Summarize model efficiency metrics
Return: Global drift detection model + interpretable visualizations
4. Implementation Steps and Outputs
Step 1: Environment Setup
Description: Installed dependencies (TensorFlow, TFF, SHAP, LIME, etc.)
Step 2: Dataset Loading
Description: Loaded and verified four datasets for FL simulation.
Output:
Step 3: Federated Client Simulation
Description: Created 5 simulated clients, each training a local drift model.
Output:
Step 4: Global Fusion Model
Description: Combined client models and trained the RandomForest fusion model.
Output:
Step 5: Explainability (XAI)
Description: Applied SHAP and LIME for global and local interpretability.
Output:
Step 6: Model Evaluation
Description: Evaluated model performance and visualized confusion matrix.
Output:
5. Results & Discussion
• Model achieved good accuracy and robustness across non-IID client data.
• SHAP analysis revealed that features such as temperature, motion activity, and
sound duration contributed significantly to drift detection.
• LIME explanations provided instance-level transparency for anomaly classification.
• The federated setup ensured data privacy while maintaining interpretability.
6. Conclusion
This experiment demonstrates a federated drift detection pipeline that:
• Preserves privacy across distributed IoT clients,
• Achieves interpretable global drift detection,
• Utilizes SHAP and LIME for transparent model reasoning.
The system is modular and can easily extend to real-time or larger multi-client scenarios.
7. Future Work
• Integrate actual TensorFlow Federated (TFF) models instead of pseudo-FL
simulation.
• Apply to streaming IoT data for real-time drift adaptation.
• Incorporate autoencoder-based local models for improved anomaly sensitivity.