Explainable AI परिचय

Python में Explainable AI

Fouad Trad

Machine Learning Engineer

मेरे बारे में

fouadtrad.jpg

फ़ुआद ट्रैड
  • Machine learning engineer
  • PhD Candidate
  • Cybersecurity के लिए AI में विशेषज्ञता
LinkedIn

mylinkedin.jpg

Python में Explainable AI

Artificial intelligence

  • AI मशीनों को मानव-जैसे कार्य करने में सक्षम बनाती है

Image showing a human playing chess with a machine.

Python में Explainable AI

Explainability की ज़रूरत

 

Image showing a closed black box system receiving an input and generating an output.

 

  • ब्लैक बॉक्स AI: निर्णय कैसे लिए गए, समझ नहीं आता
Python में Explainable AI

Explainability की ज़रूरत

 

Image showing a open box system receiving an input and generating an output.

 

  • ब्लैक बॉक्स AI: निर्णय-प्रक्रिया अस्पष्ट
  • Explainable AI: मॉडल के अंदरूनी कामकाज समझें
Python में Explainable AI

Explainability बनाम Accuracy

  • बेसिक मॉडल:

    • ज़्यादा समझाने योग्य
    • कम सटीक
  • कॉम्प्लेक्स मॉडल:

    • ज़्यादा सटीक
    • कम समझाने योग्य

Image showing AI models on a graph from basic models to complex ones (rule-based, linear models, decision trees, k-NN, SVMs, and neural networks), and highlighting that basic models are often more explainable but less precise, while complex models are highly precise but harder to interpret.

Python में Explainable AI

Decision trees बनाम Neural networks

Decision trees

शर्तों के आधार पर निर्णय-पथ दिखाएँ

Representation of a decision tree showing how predictions are made based on multiple conditions

Python में Explainable AI

Decision trees बनाम Neural networks

Decision trees

शर्तों के आधार पर निर्णय-पथ दिखाएँ

Decision tree for the admission example showing that if a student does not have undergraduate degree, they are rejected. Otherwise, they are only accepted if their grade is higher than 8.5

Python में Explainable AI

Decision trees बनाम Neural networks

Decision trees

शर्तों के आधार पर निर्णय-पथ दिखाएँ

Decision tree for the admission example showing that if a student does not have undergraduate degree, they are rejected. Otherwise, they are only accepted if their grade is higher than 8.5

Neural networks

स्वभावतः पारदर्शी नहीं

Image showing the structure of neural network: a collection of hidden layers, each having multiple neurons.

Python में Explainable AI

Decision trees बनाम Neural networks

Decision trees

शर्तों के आधार पर निर्णय-पथ दिखाएँ

Decision tree for the admission example showing that if a student does not have undergraduate degree, they are rejected. Otherwise, they are only accepted if their grade is higher than 8.5

Neural networks

स्वभावतः पारदर्शी नहीं

Image showing the same neural network receiving student features and predicting whether they should be accepted or rejected.

Python में Explainable AI

स्टूडेंट एडमिशन प्रेडिक्शन

GRE Score TOEFL Score University Rating SOP LOR CGPA Accept
337 118 4 4.5 4.5 9.65 1
316 104 3 3 3.5 8.00 1
314 103 2 2 3 8.21 0

 

  • टेस्ट स्कोर: GRE और TOEFL
  • यूनिवर्सिटी रेटिंग
  • SOP: statement of purpose
  • LOR: letter of recommendation
  • CGPA: cumulative grade point average
Python में Explainable AI

स्टूडेंट एडमिशन प्रेडिक्शन

Decision Tree
from sklearn.tree import DecisionTreeClassifier

model = DecisionTreeClassifier(max_depth=5)

model.fit(X_train, y_train)
y_pred = model.predict(y_test)
acc = accuracy_score(y_test, y_pred) print(f"Accuracy of Decision Tree: {acc}")
Accuracy of Decision Tree: 0.82
Neural Network
from sklearn.neural_network import MLPClassifier

model = MLPClassifier(hidden_layer_sizes=(1000,1000))

model.fit(X_train, y_train)
y_pred = model.predict(y_test)
acc = accuracy_score(y_test, y_pred) print(f"Accuracy of Neural Network: {acc}")
Accuracy of Neural Network: 0.9
Python में Explainable AI

Decision tree नियम

from sklearn.tree export_text

rules = export_text(model, feature_names=list(X_train.columns))

print(rules)
|--- CGPA <= 8.34
|   |--- GRE Score <= 320.50
|   |   |--- class: 0

| |--- GRE Score > 320.50 | | |--- class: 1
|--- CGPA > 8.34 | |--- GRE Score <= 319.50 | | |--- class: 1 ...
Python में Explainable AI

Model-specific बनाम Model-agnostic तकनीकें

Model-specific

किसी खास मॉडल पर लागू

Image showing a key designed for a specific lock

Python में Explainable AI

Model-specific बनाम Model-agnostic तकनीकें

Model-specific

किसी खास मॉडल पर लागू

Image showing a key designed for a specific lock

Model-agnostic

किसी भी मॉडल पर लागू

Image showing a master key that can open multiple locks

Python में Explainable AI

आगे क्या?

  • Model-specific और model-agnostic तकनीकें
  • लोकल और ग्लोबल मेथड्स
  • उन्नत विषय:
    • Explainability मेट्रिक्स
    • Unsupervised explainability
    • Generative AI explainability

Logos for the following libraries: SHAP, LIME, and Scikit-learn

Python में Explainable AI

अभ्यास करते हैं!

Python में Explainable AI

Preparing Video For Download...