Skip to main content

A toolbox for biosignal augmentation written in Python

Project description

BioAug - Biosignal Augmentation in Python

A toolbox for biosignal augmentation written in Python.

模块1

Deep learning models achieve remarkable performance with the aid of massive data. This tool allows you to customly augment your biosignals.

Table of Contents

Installation

We strongly recommend the usage of Anaconda for managing your python environments. Clone repo and install requirements.txt in a Python>=3.8.0 environment, including This set-up was tested under Windows 10 and Ubuntu 20.04.

  $ pip install bioaug

Introduction

jittering

  • bio/LocalJittering.py
    • class LocalJittering: Add noise of specific length and frequency at random locations in the biosignals.

localjittering

  • bio/RandomCutout.py
    • class RandomCutout: crop a specific length of a biosignals at a random location to simulate signal loss.

cutout

  • bio/ImpedanceVariation.py

impedance

  • bio/Distortion.py

distortion

  • bio/Drift.py

drift

magnitude warping

time warping

permutation

permutation

Usage

This library provides a series of data augmentation methods. The following is an example of using the LocalJittering method. The LocalJittering method is used to randomly add local high-frequency jitter to the input time series signal.

Parameters

  • p (float) : Probability of applying jitter, range [0, 1].
  • alpha (float, tuple, list) : Scale factor for the high-frequency noise. Can be a fixed value, a range, or a list.
  • frequency (int, tuple, list) : Frequency of jitter noise. Can be a fixed value, a range, or a list.
  • duration (int, tuple, list) : Duration (in time steps) of each jitter event. Can be a fixed value, a range, or a list.
  • num_jitters (int, tuple, list) : Number of jitter events to add. Can be a fixed value, a range, or a list.

Example Usage

  1. Fixed values, tuples, and lists combination:
from bioaug import LocalJittering

# Example of mixing fixed values, ranges (tuples), and lists
jitter = LocalJittering(
    p=0.8,                  # Probability of applying jitter
    alpha=0.5,              # Fixed alpha value
    frequency=(40, 60),     # Random frequency in the range [40, 60]
    duration=[10, 20, 30],  # Random duration chosen from the list [10, 20, 30]
    num_jitters=2           # Fixed number of jitter events
)

# Assume 'signal' is the input time-series data
augmented_signal = jitter(signal)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioaug-0.1.4.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bioaug-0.1.4-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file bioaug-0.1.4.tar.gz.

File metadata

  • Download URL: bioaug-0.1.4.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for bioaug-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7a013a963bb015e061428b66fcc07e137ba8f203ee6b8778049bd4ab59f933e6
MD5 4e91f5dcc426a3705ae66f8b13be3471
BLAKE2b-256 bb376d512ea067ee8e08140ba103d84a434edac069d7c5f4ab5dde565587f755

See more details on using hashes here.

File details

Details for the file bioaug-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: bioaug-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for bioaug-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e1162b0d8972aa0d0db7ea83a9d3f91e0e59af333338e345362d742c476a3f8b
MD5 9f949131d1854935cebc70529fde423d
BLAKE2b-256 2bef7acc6558ed3c4fcf447d097a1d7405d49f98f20b86b064072a0ba760a1ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page