{"id":37066184,"url":"https://github.com/esl-epfl/cross-domain-saliency-maps","last_synced_at":"2026-01-14T07:46:04.129Z","repository":{"id":314510689,"uuid":"970938778","full_name":"esl-epfl/cross-domain-saliency-maps","owner":"esl-epfl","description":"Pytorch/Tensorflow package for generating saliency maps for time-series models using Cross-Domain Integrated Gradients.","archived":false,"fork":false,"pushed_at":"2025-09-16T09:20:55.000Z","size":2180,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-11-09T23:12:57.643Z","etag":null,"topics":["explainable-ai","interpretability","pytorch","saliency-maps","tensorflow","time-series","xai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esl-epfl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-22T19:05:54.000Z","updated_at":"2025-10-28T11:02:56.000Z","dependencies_parsed_at":"2025-09-12T23:13:01.705Z","dependency_job_id":"5a197d8f-95d0-457f-8ec3-1dd0a39a8f05","html_url":"https://github.com/esl-epfl/cross-domain-saliency-maps","commit_stats":null,"previous_names":["esl-epfl/cross-domain-saliency-maps"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/esl-epfl/cross-domain-saliency-maps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl-epfl%2Fcross-domain-saliency-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl-epfl%2Fcross-domain-saliency-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl-epfl%2Fcross-domain-saliency-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl-epfl%2Fcross-domain-saliency-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esl-epfl","download_url":"https://codeload.github.com/esl-epfl/cross-domain-saliency-maps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esl-epfl%2Fcross-domain-saliency-maps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["explainable-ai","interpretability","pytorch","saliency-maps","tensorflow","time-series","xai"],"created_at":"2026-01-14T07:46:03.482Z","updated_at":"2026-01-14T07:46:04.122Z","avatar_url":"https://github.com/esl-epfl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timeseries Saliency Maps: Explaining models across multiple domains\n\nOfficial Pytorch/Tensorflow implementation of Cross-Domain Saliency Maps.\nThe method does not require any model model retraining or modications.\n\n[![arXiv](https://img.shields.io/badge/arXiv-2505.13100-b31b1b.svg)](https://arxiv.org/abs/2505.13100)\n\n\u003cimg src=\"https://raw.githubusercontent.com/esl-epfl/cross-domain-saliency-maps/main/figures/cross_domain_saliency_maps_banner.svg\" width=\"755\"\u003e\n\n# Installation\nInstall using ```pip```:\n```\npip install cross-domain-saliency-maps\n```\n\n# Examples\nGet started with our PyTorch/TensorFlow examples (one-click run)\n1. [Pytorch getting started](./examples/torch_demo.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/esl-epfl/cross-domain-saliency-maps/blob/main/examples/torch_demo.ipynb)\n2. [Tensorflow getting started](./examples/tensorflow_demo.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/esl-epfl/cross-domain-saliency-maps/blob/main/examples/tensorflow_demo.ipynb)\n3. [What does your model see in your EEG?](./examples/seizure_detection.ipynb) ([with MNE](https://mne.tools/stable/index.html)) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/esl-epfl/cross-domain-saliency-maps/blob/main/examples/seizure_detection.ipynb)\n4. [Explaining time-series forecasts](./examples/forecast_saliency_maps_skforecast.ipynb) ([with skforecast](https://skforecast.org/0.17.0/index.html)) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/esl-epfl/cross-domain-saliency-maps/blob/main/examples/forecast_saliency_maps_skforecast.ipynb)\n\n# Usage\nThe library supports generating saliency maps for any domain which\ncan be formulated as an invertible transformation with a differentiable\ninverse transformation. \n\nTo generate maps expressed in a domain, a corresponding ```Domain```\nobject needs to be defined. This describes the operations performed\nduring the forward and inverse transformations. \n\nImplementations for the [Frequency and Independent Component Analysis (ICA)](#saliency-maps-in-the-frequency-and-ica-domains)\ntransformations are already implemented and can be directly deployed. \nAdditionally, the libraryprovides the flexibility of \n[defining new transformations](#saliency-maps-in-any-domain).\n\n## Saliency Maps in the Frequency and ICA domains\nThe following domains are already implemented and can be\ndirectly used to generate saliency maps:\n\n1. **Time Domain.** This is the original Integrated Gradients,\nexpressing saliency maps in the raw input domain (time). The\ncorresponding ```Domain``` object is ```TimeDomain```. The map\ncan be directly generated:\n```timeIG = TimeIG(model, n_iterations, output_channel = 0)``` \n\n2. **Frequency Domain.** Each point in the map corresponds to\nthe importance of the corresponding frquency component. The \nFourier transform is used to transform the time-domain to \nthe frequency domain. The corresponding ```Domain``` object\nis ```FourierDomain```. The map can be directly generated:\n```fourierIG = FourierIG(model, n_iterations, output_channel = 0)``` \n\n3. **Independent Component Domain.** Each point in the \nmap corresponds to an independent component (IC) of the ICA\ndecomposition. Any ICA implementation can be used as long as it\ncomplies with [```sklearn.decomposition.FastICA```](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html). The domain is defined \nby ```ICADomain```. Before generating the map a ```FastICA```\nneeds to be fitted to the input sample (see [example](./examples/tensorflow_demo.ipynb)). The map can be directly generated:\n``` icaIG = ICAIG(model, fastICA, n_iterations, output_channel = 0)``` \n\n## Saliency Maps in any domain\nThe library supports extending the Cross-domain Integrated Gradients\nfor any invertible domain with a differentiable inverse transform. This\nrequires:\n1. Creating the propert ```Domain``` object describing the corresponding\ntransform. ```Domain``` objects need to inherit from ```DomainBase``` and\nimplement the required functions. More details can be found in the \nimplementation of the ```FourierDomain``` and ```ICADomain``` (\n[tensorflow](/src/cross_domain_saliency_maps/tensorflow_ig/domain_transforms.py), [pytorch](/src/cross_domain_saliency_maps/torch_ig/domain_transforms.py)).\n\n2. Calling ```CrossDomainIG``` with the new domain as the input. This\ncan be done either by creating a ```CrossDomainIG```, initializing it\nwith the new domain, or by implementing a new dedicated class inheriting\n```CrossDomainIG```. For more details check the implementations of \n```FourierIG``` and ```ICAIG```(\n[tensorflow](/src/cross_domain_saliency_maps/tensorflow_ig/cross_domain_integrated_gradients.py), [pytorch](/src/cross_domain_saliency_maps/torch_ig/cross_domain_integrated_gradients.py)).\n\n# Reference\n**BibTeX**\n```bibtex\n@article{kechris2025time,\n  title={Time series saliency maps: Explaining models across multiple domains},\n  author={Kechris, Christodoulos and Dan, Jonathan and Atienza, David},\n  journal={arXiv preprint arXiv:2505.13100},\n  year={2025}\n}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesl-epfl%2Fcross-domain-saliency-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesl-epfl%2Fcross-domain-saliency-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesl-epfl%2Fcross-domain-saliency-maps/lists"}