Giter Site home page Giter Site logo

hyun-ryu / simpsi Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 183 KB

Official code for "SimPSI: A Simple Strategy to Preserve Spectral Information in Time Series Data Augmentation", AAAI 2024.

Python 88.62% MATLAB 0.71% Shell 10.67%
data-augmentation human-activity-recognition sleep-stage-classification time-series time-series-classification

simpsi's Introduction

SimPSI: A Simple Strategy to Preserve Spectral Information in Time Series Data Augmentation

Paper

Official source code for "SimPSI: A Simple Strategy to Preserve Spectral Information in Time Series Data Augmentation", AAAI 2024 [1].

We propose a simple strategy to preserve spectral information (SimPSI) in time series data augmentation. SimPSI preserves the spectral information by mixing the original and augmented input spectrum weighted by a preservation map, which indicates the importance score of each frequency. Specifically, our experimental contributions are to build three distinct preservation maps: magnitude spectrum, saliency map, and spectrum-preservative map.

Prerequisites

  • Linux or macOS
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Signal Demodulation (Simulation)

  • Simulation dataset can be generated by running the code on MATLAB.

  • Training with SimPSI (Magnitude spectrum and Saliency map)

cd simulation
python train_nonctr.py --data_name matlab_awgn_32fsk_snr_p10p28 --exp_name ${EXP_NAME} --n_class 32 --aug_list ${AUG_LIST} --prior ${PRSRVN_MAP} --seed ${SEED}

where EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), PRSRVN_MAP is a type of preservation map (i.e., mag or slc), and SEED is a random seed value.

  • Training with SimPSI (Spectrum-preservative map)
cd simulation
python train_ctr.py --data_name matlab_awgn_32fsk_snr_p10p28 --exp_name ${EXP_NAME} --n_class 32 --aug_list ${AUG_LIST} --prior self --equalizer transformer --seed 

where EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), and SEED is a random seed value.

  • Testing
cd simulation
python test.py --data_name matlab_awgn_32fsk_snr_p10p28 --exp_name ${EXP_NAME} --n_class 32

where EXP_NAME is the name of the experiment.

Human Activity Recognition (HAR)

  • Training and Testing with SimPSI (Magnitude spectrum and Saliency map)
cd har_sleepedf
python main.py --experiment_description har_${PRSRVN_MAP} --run_description ${EXP_NAME} --selected_dataset HAR --aug_list ${AUG_LIST} --prior ${PRSRVN_MAP} --equalizer conv --eq_kernel_size 9 --mode ce --seed ${SEED}

where PRSRVN_MAP is a type of preservation map (i.e., mag or slc), EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), and SEED is a random seed value.

  • Training and Testing with SimPSI (Spectrum-preservative map)
cd har_sleepedf
python main.py --experiment_description har_self --run_description ${EXP_NAME} --selected_dataset HAR --aug_list ${AUG_LIST} --prior self --equalizer transformer --mode ctr --seed ${SEED}

where EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), and SEED is a random seed value.

Sleep Stage Detection (SleepEDF)

  • Training and Testing commands are the same as HAR, by replacing har and HAR to sleepedf and SleepEDF, respectively.

Atrial Fibrillation Classification (Waveform)

  • Training and Testing with SimPSI (Magnitude spectrum and Saliency map)
cd waveform
python -m evaluations.main_nonctr --experiment_description waveform_${PRSRVN_MAP} --run_description ${EXP_NAME} --aug_list ${AUG_LIST} --prior ${PRSRVN_MAP} --seed ${SEED}

where PRSRVN_MAP is a type of preservation map (i.e., mag or slc), EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), and SEED is a random seed value.

  • Training and Testing with SimPSI (Spectrum-preservative map)
cd waveform
python -m evaluations.main_ctr --experiment_description waveform_self --run_description ${EXP_NAME} --aug_list ${AUG_LIST} --prior self --seed ${SEED}

where EXP_NAME is the name of the experiment, AUG_LIST is a sequence of random augmentations (e.g., scale shift jitter), and SEED is a random seed value.

Citation

@article{ryu2023simpsi,
  title={SimPSI: A Simple Strategy to Preserve Spectral Information in Time Series Data Augmentation},
  author={Ryu, Hyun and Yoon, Sunjae and Yoon, Hee Suk and Yoon, Eunseop and Yoo, Chang D.},
  journal={arXiv preprint arXiv:2312.05790},
  year={2023}
}

simpsi's People

Contributors

hyun-ryu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.