Giter Club home page Giter Club logo

timexplusplus's Introduction

TimeX++: Learning Time-Series Explanations with Information Bottleneck

Accepted ICML 2024 [paper] [code]

This repository is the official PyTorch Implementation of TimeX++. Our experiments are based on TimeX, and thanks to the all original authors!

Authors: Zichuan Liu, Tianchun Wang, Jimeng Shi, Xu Zheng, Zhuomin Chen, Lei Song, Wenqian Dong, Jayantha Obeysekera, Farhad Shirani, Dongsheng Luo

Introduction

We posted an introductory presentation on this [slides], so you can get a quick overview of our works.

Citation

๐ŸŒŸ If you find this resource helpful, please consider starting this repository and cite our research:

@inproceedings{liu2024timex,
      title={TimeX++: Learning Time-Series Explanations with Information Bottleneck}, 
      author={Zichuan Liu, Tianchun Wang, Jimeng Shi, Xu Zheng, Zhuomin Chen, Lei Song, Wenqian Dong, Jayantha Obeysekera, Farhad Shirani, Dongsheng Luo},
      year={2024},
      booktitle={Proceedings of the 41st International Conference on Machine Learning}
}

Abstract

Explaining deep learning models operating on time series data is crucial in various applications of interest which require interpretable and transparent insights from time series signals. In this work, we investigate this problem from an information theoretic perspective and show that most existing measures of explainability may suffer from trivial solutions and distributional shift issues. To address these issues, we introduce a simple yet practical objective function for time series explainable learning. The design of the objective function builds upon the principle of information bottleneck (IB), and modifies the IB objective function to avoid trivial solutions and distributional shift issues. We further present TimeX++, a novel explanation framework that leverages a parametric network to produce explanation-embedded instances that are both in-distributed and label-preserving. We evaluate TimeX++ on both synthetic and real-world datasets comparing its performance against leading baselines, and validate its practical efficacy through case studies in a real-world environmental application. Quantitative and qualitative evaluations show that TimeX++ outperforms baselines across all datasets, demonstrating a substantial improvement in explanation quality for time series data.

figs

Datasets

Our running environment is same as TimeX, so all datasets can be found on here.

Requirements are found in requirements.txt. Please install the necessary requirements via pip (recommended) or conda.

How to run

Example: Detailed examples of the model are given in the experiment scripts found in experiments directory. A simple example is given for the freqshape dataset in experiments/freqshape/bc_model_ptype.py.

python bc_model_ptype.py

Reproducibility: For each dataset script, first modify the base_path to correspond to your directory.

  1. Training the black-box model $f$: Scripts used to train black-box models are included in experiments/<dataset>/train_transformer.py. Within these scripts, you can change hyperparameter choices and see usage for setting up the model, training parameters, and more detail please see Table 7 in the paper.

  2. Training TimeX++ to explain $f$: Before training, please replace the path to the trained time series predictor that you wish to explain. Then, run:

python bc_model_ptype.py

Parameters can also be modified to train ablation models (please see the paper for more details). For baseline TimeX, you can be reproduced by modifying is_timex=True at the beginning of bc_model_ptype.py, otherwise, ours is is_timex=False. For evaluation and baseline, please refer to this url.

Locations of important implementations: The TimeX++ can be found in txai/models/bc_model.py under the name TimeXModel.

Further Reading

Recommend reading the following related works included in the slides.

1, Explaining Time Series via Contrastive and Locally Sparse Perturbations, in ICLR 2024. [GitHub Repo]

@inproceedings{liu2024explaining,
      title={Explaining Time Series via Contrastive and Locally Sparse Perturbations}, 
      author={Zichuan Liu and Yingying Zhang and Tianchun Wang and Zefan Wang and Dongsheng Luo and Mengnan Du and Min Wu and Yi Wang and Chunlin Chen and Lunting Fan and Qingsong Wen},
      year={2024},
      booktitle={Proceedings of the 12th International Conference on Learning Representations},
      pages={1-21}
}

2, Protecting Your LLMs with Information Bottleneck, in Arxiv 2024. [GitHub Repo]

@misc{liu2024protecting,
      title={Protecting Your LLMs with Information Bottleneck}, 
      author={Zichuan Liu and Zefan Wang and Linjie Xu and Jinyu Wang and Lei Song and Tianchun Wang and Chunlin Chen and Wei Cheng and Jiang Bian},
      year={2024},
      eprint={2404.13968},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

timexplusplus's People

Contributors

zichuan-liu avatar eltociear avatar

Stargazers

123pp avatar khaled  avatar Zefan Wang avatar Stan avatar Zheng Liu avatar Dongsheng Luo avatar Liwei Deng avatar  avatar

Watchers

Dongsheng Luo avatar Kostas Georgiou avatar  avatar

timexplusplus's Issues

tint module

Hi, thanks for releasing your code!

I wondered what is the module "tint" used in bc_model.py ?

from tint.models import MLP, RNN

It does not seem to be in the requirements and I could not find the corresponding package (there is a package tint but it is about colors, not MLPs or RNNs..)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.