Unit 5 Advanced Topics in Data Science
Unit 5 Advanced Topics in Data Science
2. Interpretability: Ensuring that humans (both experts and non-experts) can comprehend
how the model arrived at a particular decision.
3. Trustworthiness: Allowing users to trust the model by providing insights into its
behavior and reducing biases.
Techniques in XAI
• In Healthcare: To explain AI-based diagnostic decisions and ensure doctors trust the
model.
Challenges of XAI
• Trade-off between accuracy and interpretability: More complex models (like deep
neural networks) are often less interpretable.
• Bias and fairness: XAI can reveal biases, but correcting them is still a challenge.
As AI models become more complex, techniques like LIME, SHAP, and model
interpretability help make their predictions transparent and understandable.
1. Perturbation: It creates a new dataset by perturbing the original input (slightly altering
the input values).
2. Model Prediction: The black-box model makes predictions on this new dataset.
3. Local Surrogate Model: LIME fits a simple, interpretable model (like linear regression)
to approximate the black-box model’s behavior around the instance.
4. Feature Importance: It highlights the features that influenced the specific prediction.
Example:
In a credit scoring model, LIME can explain why a specific customer was denied a loan by
identifying the top contributing features, such as:
• Low income
• High debt-to-income ratio
Advantages:
Limitations:
SHAP is a game-theoretic approach that explains the output of machine learning models by
assigning a Shapley value to each feature, indicating its contribution to the prediction. It
provides global and local interpretability.
2. Feature Attribution: Each feature receives a SHAP value, indicating how much it
contributed to pushing the prediction higher or lower.
3. Visualization: SHAP generates summary plots, dependence plots, and force plots,
making the explanations visually intuitive.
Example:
Advantages:
Limitations:
Model interpretability refers to the ability to understand and explain how a model makes
predictions. It can be categorized into:
• Intrinsic interpretability: Models that are inherently transparent (e.g., linear regression,
decision trees).
1. Feature Importance:
o Example: In a house price prediction model, location and square footage may
have higher importance than the number of bathrooms.
o Visualizes the relationship between a single feature and the model’s predictions
while keeping other features constant.
3. Permutation Importance:
o Randomly shuffles a feature and measures how the model’s accuracy changes.
1. Local Training:
Each device trains the model locally using its own data.
2. Model Update:
Instead of sending raw data, devices send the model parameters or gradients to
the central server.
3. Model Aggregation:
The server aggregates the local updates using techniques like Federated
Averaging (FedAvg).
The server updates the global model with the aggregated weights.
5. Repeat:
This process is repeated for multiple rounds until the model converges.
1. Clients: Devices or nodes that hold the data (e.g., smartphones, IoT devices).
2. Central Server: Aggregates model updates and redistributes the improved global model.
3. Communication Rounds: Iterative rounds where local updates are shared with the
server.
o Example: Multiple hospitals sharing patient data with the same features (age,
weight) but different patients.
o Devices have different feature sets but share the same samples.
Enhanced Privacy:
Decentralized Learning:
Communication Overhead:
• Frequent communication between clients and the server can slow down the process.
• Data across clients may not be independent and identically distributed (IID), making it
harder for the model to generalize.
Device Heterogeneity:
Security Risks:
Decentralized data processing complements PPML by distributing the data and computation
across multiple nodes or devices rather than relying on a central server. This enhances privacy,
reduces the risk of data breaches, and lowers communication costs.
o Description: DP adds random noise to the data or the model’s output to prevent
individual data points from being identified.
o Privacy Benefits:
▪ Even if an attacker gains access to the model, they cannot infer sensitive
information about any individual.
o Mathematical Definition:
A mechanism MMM satisfies ϵ\epsilonϵ-differential privacy if:
P(M(D)∈S)≤eϵ×P(M(D′)∈S)P(M(D) \in S) \leq e^{\epsilon} \times P(M(D') \in
S)P(M(D)∈S)≤eϵ×P(M(D′)∈S)
Where:
o Example: Apple uses DP in iOS to collect user data anonymously for feature
improvement.
o Privacy Benefits:
o Types of HE:
o Privacy Benefits:
o Example:
▪ Cryptographic Protocols:
o Description: ZKPs allow one party to prove to another that they know a value or
statement is true without revealing the value itself.
o Privacy Benefits:
o Example:
o Privacy Benefits:
o Example:
2. Edge Computing
o Privacy Benefits:
o Example:
▪ Smart cameras with built-in AI for face recognition process data locally,
reducing cloud dependency.
o Privacy Benefits:
o Example:
o Example:
o Example:
1. Exponential Speedup:
2. Efficient Parallelism:
3. Improved Optimization:
o Unlike classical bits (0 or 1), qubits can exist in a superposition of both states.
3. Entanglement:
o When two or more qubits become entangled, the state of one qubit depends on
the state of the other, no matter how far apart they are.
4. Quantum Gates:
o Common gates:
o Speedup:
o Applications:
o Speedup:
Exponential Speedup: Solve complex problems exponentially faster than classical algorithms.
Description:
Time Complexity:
Classical search: O(N)O(N)
How It Works:
Description:
Time Complexity:
How It Works:
Description:
Iteratively applies quantum gates and optimizes parameters using a classical optimizer.
Time Complexity:
How It Works:
Description:
QFT: O((logN)2)O((logN)2)
How It Works:
Uses quantum gates to transform input data into the Fourier basis.
Description:
Time Complexity:
How It Works:
Description:
Time Complexity:
QPCA: O(logN)O(logN)
How It Works:
Description:
Time Complexity:
Provides a polynomial speedup over classical algorithms.
How It Works:
2. Fairness in AI
Fairness in AI refers to ensuring that models treat all groups equitably without discrimination or
favoritism.
Dimensions of Fairness:
Demographic parity: Predictions are independent of sensitive attributes (e.g., race, gender).
Equal opportunity: Model provides equal chances for positive outcomes across groups.
Equalized odds: Ensures similar false positive/false negative rates across groups.
Counterfactual fairness: An individual would receive the same outcome regardless of their
sensitive attributes.
3. Ethical Concerns in AI
Job displacement: AI automation may replace human jobs, creating economic shifts.
These techniques modify the training data before feeding it into the model.
Data augmentation: Adds synthetic examples to make the dataset more representative.
Example:
In a dataset with 80% male and 20% female samples, re-sampling ensures a 50-50 distribution to
reduce gender bias.
2. In-processing Techniques
These techniques alter the learning algorithm to reduce bias during model training.
Example:
In Adversarial debiasing, a discriminator identifies biased predictions, and the model is penalized
for biased outputs.
3. Post-processing Techniques
Equalized odds: Adjusts thresholds to balance false positive/negative rates across groups.
Calibrated equalized odds: Ensures calibrated predictions with equalized fairness.
Example:
In credit scoring, if the model favors men over women, re-ranking adjusts the scores to ensure
gender fairness.
B) Fairness Metrics
Differential privacy: Adds random noise to the data or model outputs to prevent individual
identification.
Federated learning: Trains models across decentralized devices, without centralizing data.
SHAP (SHapley Additive exPlanations): Measures the contribution of each feature to the
model’s prediction.
Model Cards: Provide details on model architecture, data sources, and fairness metrics.
IBM AI Fairness 360 (AIF360): Library for measuring and mitigating bias.
5. Ethical AI Governance:
Emerging Trends: Sustainable AI, AI for social good, and edge AI deployment
for IoT applications
1. Sustainable AI
What is Sustainable AI?
Training large models like GPT-4 or Google’s PaLM requires thousands of GPUs,
consuming vast amounts of energy.
Carbon footprint of training GPT-3 ≈ 300,000 kg CO2, equivalent to 125 round-trip flights
from New York to Beijing.
Hardware inefficiency:
Lack of transparency:
Model compression: Reduces the size of large models through pruning, quantization, and
distillation.
Quantization: Uses fewer bits for model weights (e.g., converting from 32-bit to 8-bit
precision).
Efficient architectures:
B) Green AI Infrastructure
Cloud optimization:
Run AI models on energy-efficient cloud platforms (e.g., AWS, GCP).
C) Eco-friendly AI Algorithms
Sparse training:
Federated learning:
Google DeepMind: Uses AI to optimize energy efficiency in its data centers, reducing
cooling costs by 40%.
AI for social good refers to applying artificial intelligence technologies to address societal and
global challenges, such as healthcare, poverty, education, and climate change.
Key Areas of AI for Social Good
A) AI in Healthcare
Drug discovery:
AI models use satellite images and weather data to forecast earthquakes, floods, and storms.
Disaster management:
Rescue operations:
Wildlife conservation:
Example: PAWS (Protection Assistant for Wildlife Security) detects poaching activities.
Climate modeling:
Personalized learning:
AI-powered platforms like Khan Academy and Duolingo provide personalized content.
Language translation:
Assistive AI:
Microsoft Seeing AI: Converts visual data into audio for visually impaired users.
Refugee assistance:
IBM’s AI for Good: Uses AI to address food security and disaster preparedness.
Zebra Medical Vision: AI-based radiology scans for early disease detection.
Google Flood Forecasting: AI models predict flood patterns to prevent damage.
Edge AI refers to running AI models directly on IoT devices or edge hardware rather than in the
cloud.
IoT devices with AI detect irregular heart rates, blood pressure, etc.
Fall detection:
Traffic management:
Smart surveillance:
Predictive maintenance:
Quality control:
D) Autonomous Vehicles
Real-time decision-making:
Collision detection: