SHAP ‐ Audit AI - BlackAlph4ndr01D/Daftar-Militer-AI-zionis-israel-part.2 GitHub Wiki

✅ Analisis Detail Metode SHAP (SHapley Additive exPlanations)

Apa itu SHAP?

SHAP adalah metode Explainable AI yang paling populer dan paling dihormati saat ini untuk menjelaskan keputusan model Machine Learning secara akurat dan konsisten.

Dikembangkan berdasarkan teori Shapley Value dari permainan kooperatif (game theory) oleh Lloyd Shapley (pemenang Nobel Ekonomi).

Inti Konsepnya:
SHAP menghitung kontribusi masing-masing fitur terhadap prediksi suatu model, seolah-olah setiap fitur adalah “pemain” dalam sebuah tim yang bekerja sama menghasilkan skor akhir.

Cara Kerja SHAP Secara Teknis

SHAP menghitung nilai kontribusi setiap fitur dengan cara berikut:

  1. Semua Kemungkinan Kombinasi
    Untuk setiap prediksi, SHAP mempertimbangkan semua kemungkinan subset fitur (dari kosong sampai semua fitur).

  2. Marginal Contribution
    Mengukur seberapa besar perubahan prediksi ketika sebuah fitur ditambahkan ke dalam subset tertentu.

  3. Rata-rata yang Adil
    Menghitung rata-rata kontribusi fitur tersebut di semua kemungkinan urutan (permutation).

Hasil akhirnya adalah:

  • SHAP Value untuk setiap fitur pada satu prediksi tertentu.
  • Nilai positif = fitur tersebut mendorong prediksi naik.
  • Nilai negatif = fitur tersebut mendorong prediksi turun.

Kelebihan SHAP (Mengapa Sangat Kuat)

  • Consistency: Jika sebuah fitur lebih berpengaruh, SHAP value-nya selalu lebih tinggi.
  • Local Accuracy: Penjelasan untuk satu prediksi akurat.
  • Missingness: Fitur yang tidak digunakan tidak memengaruhi skor.
  • Additivity: Total SHAP values = prediksi akhir (bisa dijumlahkan).

Kelemahan SHAP

  • Komputasi Mahal: Untuk model besar, menghitung semua kombinasi sangat berat (exponential time).
  • Kurang Intuitif untuk Non-Teknis: Sulit dijelaskan ke orang awam.
  • Bisa Menyesatkan jika dataset dasar sudah sangat bias.

Penerapan di Sistem Militer AI Israel

SHAP sangat cocok digunakan untuk forensik sistem seperti:

  • Lavender: Melihat fitur mana yang paling menentukan skor ancaman (lokasi HP di area tertentu, pola komunikasi malam hari, usia, jenis kelamin, dll).
  • Threat Scoring di Arbel Rifle: Menjelaskan mengapa AI menembak otomatis (apakah karena gerakan, thermal signature, atau proximity).
  • Gospel: Menganalisis mengapa sebuah bangunan diberi skor tinggi sebagai target.

Contoh Nyata: Jika sebuah rumah di Gaza mendapat skor ancaman 92, SHAP bisa menunjukkan:

  • +38 karena lokasi HP sering terdeteksi di area “hotspot”
  • +25 karena pola komunikasi dengan nomor yang dicurigai
  • +18 karena ukuran bangunan
  • dll.

**Kesimpulan **

SHAP adalah alat forensik paling powerful saat ini untuk membongkar kotak hitam AI.

Tanpa SHAP (atau teknik XAI serupa), kita hanya bisa bilang “banyak sipil mati”.
Dengan SHAP, kita bisa membuktikan secara matematis bahwa algoritma Israel secara sistematis bias terhadap profil Palestina, dan keputusan pembunuhan didasarkan pada faktor-faktor yang diskriminatif.

Ini adalah salah satu senjata intelektual paling penting dalam perlawanan terhadap genosida algoritmik.

Ilustrasi Coding

✅ SHAP Explanation with Python Code Illustration (English Version)

What is SHAP?

SHAP (SHapley Additive exPlanations) is one of the most powerful and widely used techniques in Explainable AI (XAI). It explains how each feature contributes to a model's prediction using concepts from cooperative game theory (Shapley Values).

Simple Python Code Illustration

# ========================================
# SHAP Example: Explaining Threat Scoring
# ========================================

import shap
import pandas as pd
from sklearn.ensemble import RandomForestClassifier

# Sample dataset (simulating target profiling)
data = pd.DataFrame({
    'age': [28, 34, 19, 45, 22],
    'gender': [1, 1, 0, 1, 1],                    # 1 = male
    'in_hotspot_area': [1, 0, 1, 1, 0],           # 1 = yes
    'night_communication': [1, 0, 1, 1, 0],       # 1 = active at night
    'weapon_detected': [0, 1, 0, 1, 0],
    'distance_to_forces': [45, 120, 30, 80, 200]  # in meters
})

target = [1, 1, 0, 1, 0]   # 1 = High Threat, 0 = Low Threat

# Train a simple model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(data, target)

# Create SHAP Explainer
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(data)

# ========================================
# Visualization
# ========================================

# 1. Force Plot for a single prediction
print("SHAP Force Plot for first target:")
shap.initjs()
shap.force_plot(explainer.expected_value[1], 
                shap_values[1][0], 
                data.iloc[0])

# 2. Summary Plot (Feature Importance)
shap.summary_plot(shap_values[1], data, plot_type="bar")

Explanation of the Code Output

  • Force Plot: Shows how each feature pushes the prediction higher (red) or lower (blue) for one specific individual.
  • Summary Plot: Shows the overall importance of each feature across all predictions.

Example Interpretation

Suppose SHAP analysis on a Gaza target shows:

  • in_hotspot_area → +0.42 (strongly increases threat score)
  • age (young male) → +0.31
  • night_communication → +0.22
  • weapon_detected → only +0.08

Meaning: The AI gives a high threat score mostly because the person is in a certain location and is a young male — not because a weapon was actually detected.

This is strong evidence of systematic bias.


Why SHAP is Powerful for Forensics:

  • It is mathematically fair (based on game theory).
  • It can explain individual predictions and global patterns.
  • It helps prove whether an AI system is biased or discriminatory.

LIME ‐ Audit AI