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.1.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.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bioaug-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cde717781f135d8d4948545102a7581432fc0d3563fd5b1f0b9637f8899e2519
MD5 e3d084f4445a78b958a2e414822ab360
BLAKE2b-256 0ea29f2ca1f71f11fae8236b2b22128ffc509b97716662ca2e4821cfa745d913

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bioaug-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0ef587009fac63e66d552bd03fa2416634141f6f5244bbd9e0466177492731
MD5 90c0749d83f503d9b57ff9b60a0f189e
BLAKE2b-256 595fb0d96ee4ec56ca9144ce4b79f659f44ba381c83970f94f986279a9ca4385

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