{"id":15551055,"url":"https://github.com/stavrostheocharis/easy_explain","last_synced_at":"2025-10-10T03:04:00.732Z","repository":{"id":183320802,"uuid":"597480086","full_name":"stavrostheocharis/easy_explain","owner":"stavrostheocharis","description":"An XAI library that helps to explain AI models in a really quick \u0026 easy way","archived":false,"fork":false,"pushed_at":"2024-03-08T10:47:56.000Z","size":51418,"stargazers_count":16,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T13:57:05.783Z","etag":null,"topics":["artificial-intelligence","explainable-ai","explainable-artificial-intelligence","gradcam","image","lrp","occlusion","xai","xai-library","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stavrostheocharis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-04T17:24:10.000Z","updated_at":"2025-09-04T13:09:50.000Z","dependencies_parsed_at":"2024-10-02T14:02:36.235Z","dependency_job_id":"ffe13d46-217b-4d92-bcc0-60e9f1524dd1","html_url":"https://github.com/stavrostheocharis/easy_explain","commit_stats":null,"previous_names":["stavrostheocharis/easy_explain"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/stavrostheocharis/easy_explain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavrostheocharis%2Feasy_explain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavrostheocharis%2Feasy_explain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavrostheocharis%2Feasy_explain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavrostheocharis%2Feasy_explain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stavrostheocharis","download_url":"https://codeload.github.com/stavrostheocharis/easy_explain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stavrostheocharis%2Feasy_explain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002539,"owners_count":26083417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","explainable-ai","explainable-artificial-intelligence","gradcam","image","lrp","occlusion","xai","xai-library","yolov8"],"created_at":"2024-10-02T14:02:23.424Z","updated_at":"2025-10-10T03:04:00.718Z","avatar_url":"https://github.com/stavrostheocharis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n \n# Easy Explain\n\n\n[![GitHub][github_badge]][github_link]\n[![PyPI][pypi_badge]][pypi_link]\n[![Test][test_passing_badge]][test_passing_badge]\n[![Licence][licence_badge]][licence_link] \n[![Download][download_badge]][download_link]\n[![Download][total_download_badge]][download_link]\n[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-green.svg)](#supported-python-versions)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) \n\n**Simplify the Explanation of AI Models**\n \n\u003c/div\u003e\n\nUnlock the \"why\" behind your AI models' decisions with `easy-explain`, a Python package designed to democratize access to advanced XAI algorithms. By integrating state-of-the-art explanation techniques with minimal code, we make AI transparency accessible to developers and researchers alike.\n\n\u003e [!IMPORTANT]\n\u003e The new versions of `easy-explain` after 0.4.3 have breaking changes. We have changed the logic of different imports to support more models like YoloV8. Have a look at the provided [examples](https://github.com/stavrostheocharis/easy_explain/tree/main/examples).\n\n\n## Requirements\n\n### Python Versions Supported\n- **Primary**: `3.11`\n- **Also Supported**: `3.9`, `3.10`\n\nEnsure one of these Python versions is installed on your system to use `easy-explain`.\n\n\n### Install Environment \u0026 Dependencies\n\n`easy-explain` can be seamlessly integrated into your projects with a straightforward installation process:\n\n\n#### Installation as a Package\n\nTo incorporate `easy-explain` into your project as a dependency, execute the following command in your terminal:\n\n\n```bash\npip install easy-explain\n```\n\n## Features and Functionality\n\n`easy-explain` uses under the hood different packages based on the model to be used. [Captum](https://captum.ai/) is used for classification models and it aids to comprehend how the data properties impact the model predictions or neuron activations, offering insights on how the model performs. Captum comes together with [Pytorch library](https://pytorch.org/).\nThere are also other algorithms supported like GradCam or customade algorithms to support other models like the LRP implementation for YoloV8.\n\n\nCurrently, `easy-explain` specializes in specific cutting-edge XAI methodologies for images:\n\n- Occlusion: For deep insight into classification model decisions.\n- Cam: SmoothGradCAMpp \u0026 LayerCAM for explainability on image classification models.\n- Layer-wise Relevance Propagation (LRP): Specifically tailored for YoloV8 models, unveiling the decision-making process in object detection tasks.\n\n## Quick Start\n\nTo begin unraveling the intricacies of your model's decisions, import and utilize the corresponding classes as follows:\n\n```python\nfrom easy_explain import OcclusionExplain\n\nmodel = 'your-model'\n\nocclusion_explain = OcclusionExplain(model=model)\nvis_types=[[\"blended_heat_map\", \"original_image\"]]\nvis_signs = [[\"positive\",\"all\"]]\n\nocclusion_explain.generate_explanation(image_url=\"your-image\",total_preds=5,vis_types = vis_types, vis_signs = vis_signs, labels_path=\"your-labels-path\")\n\n```\n\n```python\nfrom easy_explain import YOLOv8LRP\n\nmodel = 'your-model'\nimage = 'your-image'\n\nlrp = YOLOv8LRP(model, power=2, eps=1, device='cpu')\n\nexplanation_lrp = lrp.explain(image, cls='your-class', contrastive=False).cpu()\n\nlrp.plot_explanation(frame=image, explanation = explanation_lrp, contrastive=True, cmap='seismic', title='Explanation for your class\"')\n```\n\n```python\nfrom easy_explain import YOLOv8LRP\n\nmodel = 'your-model'\nimage = 'your-image'\n\ntrans_params = {\"ImageNet_transformation\":\n  {\"Resize\": {\"h\": 224,\"w\": 224},\n  \"Normalize\": {\"mean\": [0.485, 0.456, 0.406], \"std\": [0.229, 0.224, 0.225]}}}\n\nexplainer = CAMExplain(model) \n\ninput_tensor = explainer.transform_image(img, trans_params[\"ImageNet_transformation\"])\n\nexplainer.generate_explanation(img, input_tensor, multiple_layers=[\"a_layer\", \"another_layer\", \"another_layer\"])\n```\n\nFor more information about how to begin have a look at the [examples notebooks](https://github.com/stavrostheocharis/easy_explain/tree/main/examples).\n\n## Examples\n\nExplore how `easy-explain` can be applied in various scenarios:\n\n\n\n![Use Case Example](easy_explain/images/lion-heat-map.png \"Use Case Example\")\n\n![Use Case Example](easy_explain/images/siberian-positive.png \"Use Case Example\")\n\n![Use Case Example](easy_explain/images/jiraffe-cam-method.png \"Use Case Example\")\n\n![Use Case Example](easy_explain/images/class-traffic.png \"Use Case Example\")\n\n## How to contribute?\n\n`easy-explain` thrives on community contributions, from feature requests and bug reports to code submissions. We encourage you to share your insights, improvements, and use cases to foster a collaborative environment for advancing XAI.\n\n### Getting Involved\n\nSubmit Issues: Encounter a bug or have a feature idea? Let us know through our  [issues page](https://github.com/stavrostheocharis/easy_explain/issues).\n\nCode Contributions: Interested in contributing code? Please refer to our  [`CONTRIBUTING`](https://github.com/stavrostheocharis/easy_explain/blob/main/CONTRIBUTING.md) guidelines for more information on how to get started..\n\nJoin us in making AI models more interpretable, transparent, and trustworthy with `easy-explain`.\n\n\n[github_badge]: https://badgen.net/badge/icon/GitHub?icon=github\u0026color=black\u0026label\n\n[github_link]: https://github.com/stavrostheocharis/easy_explain\n\n[pypi_badge]: https://badge.fury.io/py/easy-explain.svg\n\n[pypi_link]: https://pypi.org/project/easy-explain/\n\n[download_badge]: https://static.pepy.tech/personalized-badge/easy-explain?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=green\u0026left_text=Monthly%20Downloads\n\n[test_passing_badge]: https://github.com/stavrostheocharis/easy_explain/actions/workflows/python-app.yml/badge.svg\n\n[total_download_badge]: https://static.pepy.tech/personalized-badge/easy-explain?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=green\u0026left_text=Total%20Downloads\n\n[download_link]: https://pypi.org/project/easy-explain/#files\n\n[licence_badge]: https://img.shields.io/github/license/stavrostheocharis/easy_explain\n\n[licence_link]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavrostheocharis%2Feasy_explain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstavrostheocharis%2Feasy_explain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavrostheocharis%2Feasy_explain/lists"}