Package: biobss
BIOBSSA package for processing signals recorded using wearable sensors, such as Electrocardiogram (ECG), Photoplethysmogram (PPG), Electrodermal activity (EDA) and 3-axis acceleration (ACC).BIOBSS's main focus is to generate end-to-end pipelines by adding required processes from BIOBSS or other Python packages. Some preprocessing methods were not implemented from scratch but imported from the existing packages.Main features:Applying basic preprocessing steps (*)Assessing quality of PPG and ECG signalsExtracting features for ECG, PPG, EDA and ACC signalsPerforming Heart Rate Variability (HRV) analysis using PPG or ECG signalsExtracting respiratory signals from PPG or ECG signals and estimating respiratory rate (*)Calculating activity indices from ACC signalsGenerating and saving pipelines(*): Not all methods were implemented from scratch but imported from existing packages.The table shows the capabilites of BIOBSS and the other Python packages for physiological signal processing.FunctionalityBIOBSSBioSPPyHeartPyHRVhrv-analysispyHRVpyPhysioPySiologyNeurokit2FLIRTFile reader✓✓✓Sliding window✓✓✓Preprocessing✓✓✓✓Pipeline✓(*)✓ProcessingECG✓✓✓✓✓PPG✓✓✓✓✓✓IBI / RRI✓✓✓✓✓✓✓✓EDA✓✓✓✓✓✓ACC✓✓✓Feature ExtractionECG✓PPG✓EDA✓✓ACC✓✓(*): Pipeline module differs between the two packages. BIOBSS pipeline aims to provide a more flexible and customizable pipeline for the user.Modified fromFöll, Simon, et al. “FLIRT: A feature generation toolkit for wearable data.” Computer Methods and Programs in Biomedicine 212 (2021): 106461.You can also read theblog post about BIOBSS.PreprocessingBIOBSS has modules with basic signal preprocessing functionalities. These include:ResamplingSegmentationNormalizationFiltering (basic filtering functions with commonly used filter parameters for each signal type)Peak detectionVisualizationBIOBSS has basic plotting modules specific to each signal type. Using the modules, the signals and peaks can be plotted using Matplotlib or Plotly packages.Signal Quality AssessmentSignal quality assessment steps listed below can be used with PPG and ECG signals.Clipping detectionFlatline detectionPhysiological checksMorphological checksTemplate matchingFeature ExtractionSignalDomain / TypeFeaturesECGTimeMorphological features related to fiducial point locations and amplitudesPPGTimeMorphological features related to fiducial point locations and amplitudes, zero-crossing rate, signal to noise ratioFrequencyAmplitude and frequency of FFT peaks, signal powerStatisticalMean, median, standard deviation, percentiles, mean absolute deviation, skewness, kurtosis, entropyVPGTimeMorphological features related to fiducial point locations and amplitudesAPGTimeMorphological features related to fiducial point locations and amplitudesACCFrequencyMean, median, standard deviation, min, max, range, mean absolute deviation, median absolute deviation, interquartile range, skewness, kurtosis, energy, entropy of fft signal; fft-peak related features and signal powerStatisticalMean, median, standard deviation, min, max, range, mean absolute deviation, median absolute deviation, interquartile range, skewness, kurtosis, energy, momentum of ACC signals; peak related featuresCorrelationCorrelation of ACC signals of different axesEDATimeRms, acr length, integral, average powerFrequencyFFT peak related features, energy, entropy of fft signalStatisticalMean, standard deviation, min, max, range, kurtosis, skewness, momentumHjorthActivity, complexity, mobilityHeart Rate Variability AnalysisHeart rate variability analysis can be performed with BIOBSS and the parameters given below can be calculated for PPG or ECG signals.DomainParametersTime-domainmean_nni, sdnn, rmssd, sdsd, nni_50, pnni_50, nni_20, pnni_20, cvnni, cvsd, median_nni, range_nni mean_hr, min_hr, max_hr, std_hr, mad_nni, mcv_nni, iqr_nniFrequency-domainvlf, lf, hf, lf_hf_ratio, total_power, lfnu, hfnu, lnLF, lnHF, vlf_peak, lf_peak, hf_peakNonlinearSD1, SD2, SD2_SD1, CSI, CVI, CSI_mofidied, ApEn, SampEnActivity IndicesBIOBSS has functionality to calculate activity indices from 3-axis acceleration signals. These indices are:Proportional Integration Method (PIM)Zero Crossing Method (ZCM)Time Above Threshold (TAT)Mean Amplitude Deviation (MAD)Euclidian Norm Minus One (ENMO)High-pass Filtered Euclidian (HFEN)Activity Index (AI)Reference:https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0261718The preprocessing steps which should be applied on the raw acceleration differs for each of the activity indices listed above. In other words, each activity index can be calculated only from specific datasets. These datasets can be generated using BIOBSS both independently or as a part of activity index calculation pipeline.The generated datasets are:UFXYZ: unfiltered acc signalsUFM: magnitude of unfiltered acc signalsUFM_modified: modified magnitude of unfiltered signals (absolute(UFM-length(UFM)))UFNM: normalized magnitude of unfiltered acc signalsFXYZ: filtered acc signalsFXYZ_modified: modified filtered acc signals (absolute(FXYZ))FMpre: magnitude of filtered acc signalsSpecialXYZ: filtered acc signals (special filter parameters)SpecialM: magnitude of filtered acc signals (special filter parameters)FMpost: filtered magnitude of acc signalsFMpost_modified: modified of filtered magnitude of acc signals (absolute(FMpost))Respiratory AnalysisBIOBSS has modules to perform basic respiratory analyses. The functionalities are:Preprocessing PPG or ECG signals for respiratory analysis using predefined filter parametersExtracting respiratory signals from modulations (amplitude modulation, frequency modulation, baseline wander) in PPG or ECG signalsEstimating respiratory rate from the extracted respiratory signalsCalculation respiratory quality indices (RQI)Fusing respiratory rate estimatesPipeline GenerationThe main focus of BIOBSS is to generate and save pipelines for signal processing and feature extraction problems. Thus, it is aimed to :Simplify the preprocessing procedures by generating signal and event channelsMake it easy to use processesDecrease the amount of work for repetitive processes and for those who work on multiple datasetsMake it possible to save and share pipelines to compare results of different worksTo learn more, visit theDocumentation page.InstallationThrough pip,pip install biobssor build from source,git clone https://github.com/obss/biobss.git
cd BIOBSS
python setup.py installDependenciesneurokit2antropycvxoptheartpyscipypy_ecg_detectorsTutorial notebooksPPG Signal ProcessingECG Signal ProcessingACC Signal ProcessingHRV AnalysisRespiratory AnalysisLicenseLicensed under theMITLicense.ContributingIf you have ideas for improving existing features or adding new features to BIOBSS, please contact us.ContributorsÇağatay Taşcıİpek KarakuşDevrim ÇavuşoğluFatih Çağatay Akyön