Package: lrp-pf-auc
Layer-Wise Relevance PropagationPyTorch implementation of Layer-wise Relevance Propagation (LRP) algorithm together with quantitative evaluation metrics to compare heatmap explanations objectively.Special thanks to Dr. Grégoire Montavon for his insights, which shaped the development of this project.FeaturesExplainability:Layer-wise Relevance Propagation (LRP)Quantitative Evaluation:Pixel Flipping (PF), also known as Region Perturbation (RP)Perturbation modes:inpaintingrandomSort objectives:most relevant first (MoRF), also known as activation curveleast relevant first (LRF), also known as pruning curverandomAUC (Area Under the Curve), also known as AUAC (Area Under the Activation Curve) or AU-MSE (Area Under the Mean Squared Error Curve) depending on the sort objectiveShowcaseLRP(lrp-tutorialcomposite) andPFwithinpaintingperturbation mode and sort objectiveMoRF.Classification scores of castle image withinpaintingperturbation modeNumber of simultaneous flips per perturbation step during Pixel-Flipping.PF perturbation mode randomLRP(lrp-tutorialcomposite) andPFwithrandomperturbation mode and sort objectiveMoRF.Classification scores of castle image with random perturbation modeRequirementspython3>= 3.9Installationpython3-mpipinstalllrp-pf-aucThe PyPI distributionlrp-pf-aucprovides the following two packages:lrpandpf.The namelrp-pf-aucstands for Layer-wise Relevance Propagation (LRP), Pixel Flipping (PF), and Area Under the Curve (AUC) respectively.UsageRefer todemo.ipynbfor an example of Layer-wise Relevance Propagation (LRP), Pixel-Flipping (PF) and Area under the Curve (AUC).Feel free to check out the Jupyter notebooks underexperiments/notebooksfor a chronological overview of the project.Related ProjectsSequential LRP implementation:gmontavon/lrp-tutorialTutorial on how to implement LRPUpdated version ofgmontavon/lrp-tutorial:rodrigobdz/lrp-tutorialForward-hook LRP implementation:chr5tphr/zennitImplementation of LRP-based methods in PyTorchinnvestigate-based LRP implementation:moboehle/Pytorch-LRPCaffe-based LRP implementation:lrp_toolboxPixel-Flipping and Region Perturbation implementation:understandable-machine-intelligence-lab/QuantusCitationCite as:Plaintext:Rodrigo Bermúdez Schettino. (2022). rodrigobdz/lrp: v0.1.6 (v0.1.6). Zenodo.https://doi.org/10.5281/zenodo.6821295BibTeX:@software{rodrigo_bermudez_schettino_2022_6821295,
  author       = {Rodrigo Bermúdez Schettino},
  title        = {rodrigobdz/lrp: v0.1.6},
  month        = jul,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v0.1.6},
  doi          = {10.5281/zenodo.6821295},
  url          = {https://doi.org/10.5281/zenodo.6821295}
}CreditsThe structure of this readme is based onminimal-readmeScripts followPersonal Shell Style GuideThelrppackage usestwo customized filesoriginally fromchr5tphr/zennit.The syntax for defining custom composites is inspired bythis discussiononzennit's repo.This implementation is based on insights from:LRP overview paperG. Montavon, A. Binder, S. Lapuschkin, W. Samek, K.-R. MüllerLayer-wise Relevance Propagation: An Overviewin Explainable AI: Interpreting, Explaining and Visualizing Deep Learning, Springer LNCS, vol. 11700, 2019Original LRP paperS. Bach, A. Binder, G. Montavon, F. Klauschen, K.-R. Müller, W. SamekOn pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagationPloS ONE 10 (7), e0130140, 2015ECML/PKDD 2020 Tutorial: Explainable AI for Deep Networks: Basics and Extensions (Part 3)LicenseMIT©rodrigobdz