Coder Social home page Coder Social logo

mims-harvard / timex Goto Github PK

View Code? Open in Web Editor NEW
24.0 4.0 1.0 29.74 MB

Time series explainability via self-supervised model behavior consistency

Home Page: https://zitniklab.hms.harvard.edu/projects/TimeX

Python 50.41% Jupyter Notebook 49.43% Shell 0.16%
deep-learning explainability explainable-ai interpretability interpretable-deep-learning time-series time-series-analysis transformers

timex's Introduction

TimeX: Encoding Time-Series Explanations through Self-Supervised Model Behavior Consistency

NeurIPS 2023 (Spotlight award)

Authors: Owen Queen, Tom Hartvigsen, Teddy Koker, Huan He, Theodoros Tsiligkaridis, Marinka Zitnik

Overview

TimeX is a novel time series explainer that explains time series classification models through learning an interpretable surrogate model. This interpretable surrogate model learns an explanation embedding space that is optimized to have similar structure to that of the original reference model. To learn this explanation embedding space, we design a novel training objective, model behavior consistency, which trains the model to capture similar relationships between samples represented by the reference model. This explanation embedding space allows us to learn landmark explanations, which are explanations that are representative of broader predictive patterns in the entire dataset. Landmark explanations allow users to compare explanations across multiple samples, an important component for time series as predictive patterns are harder to intuitively understand through visual inspection of the time series sample. We demonstrate TimeX's capabilities on four novel synthetic datasets and four real-world time series datasets.

Architecture

Installation

You'll need to locally install a reference to the txai package, which contains commonly-used utilities, model architectures, and training procedures. To install, navigate to the base directory */TimeX/ and run:

python -m pip install -e .

This should install the references that you need to run scripts in the experiments directory.

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

Datasets

All datasets can be found on the Harvard Dataverse here: https://doi.org/10.7910/DVN/B0DEQJ.

Usage

Example: Detailed examples of the model are given in the experiment scripts found in experiments directory. A good reference for a real-world dataset is given for the Epilepsy dataset in experiments/epilepsy/bc_model_ptype.py.

Locations of important implementations: The TimeX model can be found in txai/models/bc_model.py under the name TimeXModel. The novel model behavior consistency (MBC) loss is found in txai/utils/predictors/loss_cl.py.

Reproducing experiments

All of our experiments can be reproduced by following the instructions in reproducibility.md, which also contains information on how to train TimeX.

Citation and Paper Availability

You can find the arXiv version of the paper here: https://arxiv.org/abs/2306.02109.

Please cite our paper with the following BibTex:

@inproceedings{queen2023encoding,
title     = {Encoding Time-Series Explanations through Self-Supervised Model Behavior Consistency},
author    = {Queen, Owen and Hartvigsen, Thomas and Koker, Teddy and Huan, He and Tsiligkaridis, Theodoros and Zitnik, Marinka},
booktitle = {Proceedings of Neural Information Processing Systems, NeurIPS},
year      = {2023}
}

timex's People

Contributors

owencqueen avatar teddykoker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

xinformatics

timex's Issues

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.