Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

816-NEW-dashboard-add-text #855

Merged
merged 52 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6659a59
Update README.md
elboyran Sep 20, 2024
54aa78d
Update dashboard readme.md
elboyran Sep 20, 2024
6782d9d
added more initial text (from Laura in old branch, commit c7cb4358770…
elboyran Sep 20, 2024
6012acc
a smaller logo for the dashboard HOME page
elboyran Sep 20, 2024
d16ced1
Update Home.py
elboyran Sep 20, 2024
8e8d328
Update Home.py
elboyran Sep 20, 2024
8200250
Update Home.py
elboyran Sep 20, 2024
9ad06d4
Update Home.py
elboyran Sep 20, 2024
170cdc1
trying to fix whitespaces...
elboyran Sep 20, 2024
bbc0974
trying to fix whitespaces...
elboyran Sep 20, 2024
30f4bc6
fixing too long lines
elboyran Sep 20, 2024
41117c6
first simple version of the text on the landing page.
elboyran Sep 20, 2024
5466e47
used colormap
elboyran Sep 20, 2024
985db10
final proposal dashboard's landing page text (and images)
elboyran Sep 20, 2024
ce5292b
update test
laurasootes Sep 23, 2024
b92afc6
update tests
laurasootes Sep 23, 2024
9c9a064
more centered text on landing page
elboyran Sep 25, 2024
7e76396
addressed review remarks on the landing page text
elboyran Sep 25, 2024
af4497d
data instance' for coherence
elboyran Sep 25, 2024
d425bee
changing page names
elboyran Sep 25, 2024
e2caa31
Added explanatory text and colormap image for the Image classificatio…
elboyran Sep 25, 2024
0f65ffb
fixing linter issues
elboyran Sep 25, 2024
6312bfc
auto fixing linter issues
elboyran Sep 25, 2024
2302d73
added explanatory texts to Tabular page and examples
elboyran Sep 25, 2024
f447e29
Explanatory test for the Text page and example
elboyran Sep 26, 2024
e82bbfc
Time series page explanatory text.
elboyran Sep 26, 2024
5f96ce3
TS weather example: explanation text
elboyran Sep 27, 2024
0b576d9
TS FRB example: explanation text
elboyran Sep 27, 2024
3400d33
TS FRB example fixing case name string in code
elboyran Sep 27, 2024
e2454f1
TS test fixed locator name (Weatehr -> Season)
elboyran Sep 27, 2024
cf7872d
fix example name
laurasootes Sep 27, 2024
23a5b99
Update dianna/dashboard/Home.py
elboyran Oct 2, 2024
b0ba712
Update dianna/dashboard/Home.py
elboyran Oct 2, 2024
9663768
Update dianna/dashboard/pages/Tabular.py
elboyran Oct 2, 2024
063048a
Update dianna/dashboard/pages/Tabular.py
elboyran Oct 2, 2024
c4ab945
Update dianna/dashboard/pages/Tabular.py
elboyran Oct 2, 2024
afba4b5
Update dianna/dashboard/pages/Tabular.py
elboyran Oct 2, 2024
a28ab1b
Update dianna/dashboard/pages/Tabular.py
elboyran Oct 2, 2024
a065ad3
fixing linter error
elboyran Oct 2, 2024
725607b
removed redundat explanations in Tabular page
elboyran Oct 2, 2024
ccd6136
fixing linter error
elboyran Oct 2, 2024
b4fdc09
removed the scaling explanations.
elboyran Oct 2, 2024
e05557d
collapse description of the explanation
laurasootes Oct 2, 2024
9f90af4
remove unused import
laurasootes Oct 2, 2024
e09520e
fix linting
laurasootes Oct 3, 2024
d9d7cd6
move description of explanation above description of example
laurasootes Oct 3, 2024
b178f07
remove centering
laurasootes Oct 3, 2024
e069233
Update Images.py
elboyran Oct 3, 2024
025ff48
Update Tabular.py
elboyran Oct 3, 2024
684a7f0
Update Text.py
elboyran Oct 3, 2024
1579122
Update Tabular.py
elboyran Oct 3, 2024
3bd155f
Update Time_series.py
elboyran Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ The default hyperparameters used in DIANNA for each explainer as well as the val
Explore the explanations of your trained model using the DIANNA dashboard (for now images, text and time series classification is supported).
[Click here](https://github.com/dianna-ai/dianna/tree/main/dianna/dashboard) for more information.

<a href="https://github.com/dianna-ai/dianna/tree/main/dianna/dashboard" target="_blank">
<img width="1000" align="center" alt="Dianna dashboard screenshot" src="https://raw.githubusercontent.com/dianna-ai/dianna/main/dianna/dashboard/dashboard-screenshot.png">
</a>
_Dianna dashboard screenshot here_
<!-- <a href="https://github.com/dianna-ai/dianna/tree/main/dianna/dashboard" target="_blank">
<img width="1000" align="center" alt="Dianna dashboard screenshot" src="https://raw.githubusercontent.com/dianna-ai/dianna/main/dianna/dashboard/dashboard-screenshot.png">
</a>
-->

## Datasets

Expand Down
49 changes: 43 additions & 6 deletions dianna/dashboard/Home.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,55 @@

# Display the content of the selected page
if selected == "Home":
elboyran marked this conversation as resolved.
Show resolved Hide resolved
st.image(str(data_directory / 'logo.png'))
st.image(str(data_directory / 'logo.png'), width = 360)

st.markdown("""
DIANNA is a Python package that brings explainable AI (XAI) to your research project.
It wraps carefully selected XAI methods in a simple, uniform interface. It's built by,
with and for (academic) researchers and research software engineers working on machine
learning projects.
**DIANNA** (Deep Insight And Neural Network Analysis) is a Python package that brings explainable AI (XAI)
to your research project. <br>
It wraps _systematically_ selected XAI methods (**explainers**) in a simple, uniform interface.<br>
It's built by, with and for academic researchers and research software engineers
who use AI, but users not need to be XAI experts! <br>
DIANNA supports the de-facto standard format of neural network models - [ONNX](https://onnx.ai/:).

### More information
### Dashboard
The DIANNA dashboard can be used for explanation of the outcomes of several ONNX models trained for the tasks
and datasets presented
in the [DIANNA Tutorials](https://github.com/dianna-ai/dianna/tree/main/tutorials#datasets-and-tasks).

The dashboard shows the visual explanation of a models' outcome
on a selected data _instance_ by one or more selected explainers. <br>
It allows you to compare the results of different explainers, as well as explanations
of the top ranked predicted model outcomes.

There are separate sections for each of the different _data modalities_ supported by DIANNA:
:gray-background[**Image**], :gray-background[**Text**],
:gray-background[**Tabular**], and :gray-background[**Time series**] data. <br>
The visual explanation is an overlaid on the data instance :rainbow-background[**heatmap**]
highlighting the relevance (attribution) of each data instance _element_ to a selected model's outcome.<br>
The data element for images is a (super)pixel, for text - a word, for tabular data - an attribute,
and for time-series - a time interval. Attributions can be positive, negative or irrelevant.<br>
To interpret heatmaps, note that attributions are bound between -1 and 1.
The maximum (positive) value is set to 1 and the minimum (negative) value to -1.<br>
The dashboard uses the _bwr (blue white red)_ colormap assigning :blue[**blue**] color to negative
relevances, **white** color to near-zero values, and :red[**red**] color to positive values.

""",
unsafe_allow_html=True)

st.image(str(data_directory / 'colormap.png'), width = 660)

st.markdown("""
The dashboard _primarily_ illustrates the examples from the DIANNA tutorials.

It is also possible to upload _own_ trained (ONNX) model and data item for which you would like
the model's decision explanation.<br>
You can then select the explainer you want to use and set its hyperparameters.

### More information

- [Source code](https://github.com/dianna-ai/dianna)
- [Documentation](https://dianna.readthedocs.io/)
- [XAI choice](https://blog.esciencecenter.nl/how-to-find-your-artificial-intelligence-explainer-dbb1ac608009)
""",
elboyran marked this conversation as resolved.
Show resolved Hide resolved
unsafe_allow_html=True)

Expand Down
3 changes: 2 additions & 1 deletion dianna/dashboard/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DIANNA dashboard

![Dianna dashboard screenshot](./dashboard-screenshot.png)
<!-- ![Dianna dashboard screenshot](./dashboard-screenshot.png) -->
_Dianna dashboard screenshot here_

The DIANNA dashboard can be used for simple exploration of your trained model explained by DIANNA. The dashboard produces the visual explanation of your selected XAI method. Additionally it allows you to compare the results of different XAI methods, as well as explanations of the top ranked predicted labels. The dashboard was created using [streamlit](https://streamlit.io/).

Expand Down
Binary file added dianna/data/colormap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/test_dashboard_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def test_page_load(page: Page):
expect(page).to_have_title("Dianna's dashboard")

for selector in (
page.get_by_role('img', name='0'),
page.get_by_text('More information'),
page.get_by_role("img", name="0").first,
page.get_by_role("heading", name="Dashboard"),
):
expect(selector).to_be_visible()

1 change: 0 additions & 1 deletion tests/test_dashboard_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def test_tabular_penguin(page: Page):
page.get_by_text('Running...').wait_for(state='detached', timeout=300_000)

for selector in (
page.get_by_text('Predicted class:'),
page.get_by_test_id('stMetricValue').get_by_text('Gentoo'),
page.get_by_role('heading', name='RISE').get_by_text('RISE'),
page.get_by_role('heading', name='KernelSHAP').get_by_text('KernelSHAP'),
Expand Down
Loading