Skip to content

Xai

Core interface for XAI in AUCMEDI: aucmedi.xai.decoder.xai_decoder

XAI Methods

The XAI Decoder can be run with different XAI methods as backbone.

A list of all implemented methods and their keys can be found here:
aucmedi.xai.methods

Example
# Create a DataGenerator for data I/O
datagen = DataGenerator(samples[:3], "images_xray/", labels=None, resize=(299, 299))

# Get a model
model = NeuralNetwork(n_labels=3, channels=3, architecture="Xception",
                       input_shape=(299,299))
model.load("model.xray.keras")

# Make some predictions
preds = model.predict(datagen)

# Compute XAI heatmaps via Grad-CAM (resulting heatmaps are stored in out_path)
xai_decoder(datagen, model, preds, method="gradcam", out_path="xai.xray_gradcam")