temporalcontext-bayesdl

Enhancing Time-Series Prediction with Temporal Context Modeling: A Bayesian and Deep Learning Synergy

https://github.com/imics-lab/temporalcontext-bayesdl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Enhancing Time-Series Prediction with Temporal Context Modeling: A Bayesian and Deep Learning Synergy

Basic Info
  • Host: GitHub
  • Owner: imics-lab
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 4.07 MB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

TemporalContext-BayesDL

Enhancing Time-Series Prediction with Temporal Context Modeling: A Bayesian and Deep Learning Synergy

Conference

Table of Contents

Description

This repository contains Python code using a combination of Deep Learning and Bayesian Models. Alongside training a deep learning model, we construct a Conditional Probability Table (CPT) during training to capture label transitions. During inference, these CPTs are utilized to adjust the predicted class probabilities of each window, taking into account the predictions of preceding windows. Our experimental analysis, focused on Human Activity Recognition (HAR) time series datasets, demonstrates that this approach not only surpasses the baseline performance of standalone deep learning models but also outperforms contemporary state-of-the-art methods that integrate temporal context into time series prediction.

Dependencies

  • Python 3.10
  • TensorFlow 2.x
  • NumPy
  • SciPy
  • Matplotlib
  • Seaborn
  • Pandas
  • Scikit-learn
  • tsai
  • PyTorch

Installation

To install and run Temporal Context in Bayesian Deep Learning, follow these steps:

```bash git clone https://github.com/imics-lab/TemporalContext-BayesDL.git cd TemporalContext-BayesDL conda env create -f environment.yml

```

Usage

To use this project, run the main script after installation:

```bash python scripts/main.py

```

Models

Example

Training:

```python from loaddata import getdataset from BayesMethod import learn_cpts

xtrain, ytrain, xvalid, yvalid, xtest, ytest, ksize, EPOCHS, tnames = getdataset(dataset) y = np.argmax(ytrain, axis=-1) k = 20 # Number of previous states to consider cpts = learncpts(y, k) # Learning CPTs with open('cpts.pickle', 'wb') as handle: pickle.dump(cpts, handle, protocol=pickle.HIGHESTPROTOCOL) #save the CPTs from the training phase and use them later in the inference phase ``` Inference:

```python from BayesMethod import Bayesianprobabilities, combineprobabilities from utils import tunelambdavalue

with open('cpts.pickle', 'rb') as handle: cpts = pickle.load(handle) numclasses = ytrain.shape[1] # Number of classes sequence = ytest dlprobs = loadedprobabilities[dataset] # Deep learning probabilities lambdavalues = np.linspace(0, 1, 11) # Example list of lambda values lambdavalue = tunelambdavalue(xvalid, yvalid, cpts, dlprobsvalid, lambdavalues) bayesianprobs = Bayesianprobabilities(cpts, sequence, numclasses) # Calculating Bayesian probabilities combinedprobs = combineprobabilities(dlprobs, bayesianprobs, lambdavalue) # Combining probabilities ```

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Citation

bibtex @inproceedings{irani2024enhancing, title={Enhancing Time-Series Prediction with Temporal Context Modeling: A Bayesian and Deep Learning Synergy}, author={Irani, Habib and Metsis, Vangelis}, booktitle={The International FLAIRS Conference Proceedings}, volume={37}, year={2024} }

Owner

  • Name: Intelligent Multimodal Computing and Sensing Laboratory (IMICS Lab) - Texas State University
  • Login: imics-lab
  • Kind: organization
  • Location: United States of America

This is the public GitHub page of the Intelligent Multimodal Computing and Sensing Laboratory (IMICS Lab)

Citation (CITATION.cff)


# See GiHub's Doc on citation files: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

# Below is the citation for this template repository. Replace it with your own!


cff-version: 1.0.0
title: >-
  TemporalContext-BayesDL
message: >-
  If you find this project or code useful, please consider citing it as below!
type: software
authors:
  - given-names: Habib
    family-names: Irani
    email: habibirani@txstate.edu
    affiliation: Computer Science Department, Texas State University 
    orcid: 'https://orcid.org/0000-0002-8117-0778 '


GitHub Events

Total
  • Watch event: 6
Last Year
  • Watch event: 6

Dependencies

environment.yml pypi