Skip to content

Commit edd1396

Browse files
Reformat (#4)
* Refactored parts * Added LRP class for Yolov8 explanations * Added LRP for Yolo notebook example * Added base explainability class * Adjusted occlusion explainability in class definition for abstracted use * Updated README * Adjusted README file * Added packages * Changed version and setup
1 parent 83ec94d commit edd1396

27 files changed

+2958
-616
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,7 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130-
.xenv
130+
.xenv
131+
132+
# Ignore possible downloads for models
133+
ultralyticsplus

README.md

Lines changed: 80 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,111 @@
11
<div align="center">
2+
3+
# Easy Explain
24

3-
# Easy explain
4-
[![Python Version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue.svg)](#supported-python-versions)
5+
[![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-green.svg)](#supported-python-versions)
6+
[![GitHub][github_badge]][github_link]
7+
[![PyPI][pypi_badge]][pypi_link]
8+
[![Download][download_badge]][download_link]
59
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
6-
[![License](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/stavrostheocharis/easy_explain/blob/main/LICENSE)
10+
[![Licence][licence_badge]][licence_link]
711

8-
**Explain AI models easily**
12+
**Simplify the Explanation of AI Models**
13+
14+
</div>
915

16+
Unlock 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.
17+
18+
> [!IMPORTANT]
19+
> The new version of `easy-explain` has 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).
1020
11-
</div>
1221

1322
## Requirements
14-
### Python version
15-
* Main supported version : <strong>3.9</strong> <br>
16-
* Other supported versions : <strong>3.7</strong> & <strong>3.8</strong>
1723

18-
To use the scripts on your computer, please make sure you have one of these versions installed.
24+
### Python Versions Supported
25+
- **Primary**: `3.10`
26+
- **Also Supported**: `3.8`, `3.9`
27+
28+
Ensure one of these Python versions is installed on your system to use `easy-explain`.
29+
1930

20-
### Install environment & dependencies
31+
### Install Environment & Dependencies
2132

22-
In order to install the current repo you have 2 options:
23-
- Pip install it directly from git inside your prefered repo and use it as a package
33+
`easy-explain` can be seamlessly integrated into your projects with a straightforward installation process:
2434

25-
#### Installation as a package
2635

27-
In order to use the current repo as a package you need to run the command below inside your project.
36+
#### Installation as a Package
37+
38+
To incorporate `easy-explain` into your project as a dependency, execute the following command in your terminal:
39+
2840

2941
```bash
3042
pip install easy-explain
3143
```
3244

33-
## Information about the functionality
45+
## Features and Functionality
46+
47+
`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/).
48+
There are also other customade algorithms to support other models like the LRP implementation for YoloV8.
49+
3450

35-
easy-explain uses under the hood [Captum](https://captum.ai/). Captum 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/).
51+
Currently, `easy-explain` specializes in two cutting-edge XAI methodologies for images:
3652

37-
Currently easy-explain is working only for images and only for Pytorch.
53+
- Occlusion: For deep insight into classification model decisions.
54+
- Layer-wise Relevance Propagation (LRP): Specifically tailored for YoloV8 models, unveiling the decision-making process in object detection tasks.
3855

39-
You can import the main function of the package 'run_easy_explain' directly as:
56+
## Quick Start
57+
58+
To begin unraveling the intricacies of your model's decisions, import and utilize the corresponding classes as follows:
59+
60+
```python
61+
from easy_explain.methods.occlusion.occlusion import OcclusionExplain
62+
63+
```
4064

4165
```python
42-
from easy_explain.easy_explain import run_easy_explain
66+
from easy_explain.methods.lrp.yolov8.yolo import YOLOv8LRP
4367

4468
```
69+
4570
For more information about how to begin have a look at the [examples notebooks](https://github.com/stavrostheocharis/easy_explain/tree/main/examples).
4671

72+
## Examples
73+
74+
Explore how `easy-explain` can be applied in various scenarios:
75+
76+
77+
78+
![Use Case Example](easy_explain/images/lion-heat-map.png "Use Case Example")
79+
80+
![Use Case Example](easy_explain/images/siberian-positive.png "Use Case Example")
81+
82+
![Use Case Example](easy_explain/images/class-traffic.png "Use Case Example")
83+
4784
## How to contribute?
4885

49-
We welcome any suggestions, problem reports, and contributions!
50-
For any changes you would like to make to this project, we invite you to submit an [issue](https://github.com/stavrostheocharis/easy_explain/issues).
86+
`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.
87+
88+
### Getting Involved
89+
90+
Submit Issues: Encounter a bug or have a feature idea? Let us know through our [issues page](https://github.com/stavrostheocharis/easy_explain/issues).
91+
92+
Code 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..
93+
94+
Join us in making AI models more interpretable, transparent, and trustworthy with `easy-explain`.
95+
96+
97+
[github_badge]: https://badgen.net/badge/icon/GitHub?icon=github&color=black&label
98+
99+
[github_link]: https://github.com/stavrostheocharis/easy_explain
100+
101+
[pypi_badge]: https://badge.fury.io/py/easy-explain.svg
102+
103+
[pypi_link]: https://pypi.org/project/easy-explain/
104+
105+
[download_badge]: https://badgen.net/pypi/dm/easy-explain
106+
107+
[download_link]: https://pypi.org/project/easy-explain/#files
51108

52-
For more information, see [`CONTRIBUTING`](https://github.com/stavrostheocharis/easy_explain/blob/main/CONTRIBUTING.md) instructions.
109+
[licence_badge]: https://img.shields.io/github/license/stavrostheocharis/streamlit-token-craft
53110

111+
[licence_link]: LICENSE

easy_explain/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
from easy_explain.easy_explain import run_easy_explain
1+
# from easy_explain.easy_explain import run_easy_explain
2+
from easy_explain import methods

easy_explain/easy_explain.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

easy_explain/functions.py

Lines changed: 0 additions & 137 deletions
This file was deleted.

easy_explain/images/class-traffic.png

261 KB
Loading

easy_explain/images/lion-heat-map.png

383 KB
Loading
275 KB
Loading

easy_explain/methods/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)