dedeus10 / BloodPressure_PPG_ML

Repository from final conclusion work of Computer Engineering. Estimation of Systolic and Diastolic Blood Pressure Using PPG and ECG Signals and Machine Learning Algorithms
43 stars 19 forks source link

Question about Dataset #1

Open huwenfeng233 opened 2 months ago

huwenfeng233 commented 2 months ago

Hello Luis Felipe de Deus thank you for sharing this code. I have some questions regarding the data, particularly in the 'case27' folder. In the file named 'uq_case27_10.csv', the DBP value is 34, which seems unusual for typical data. Could you please provide information about the source of this data? Alternatively, could you share the model you trained? Thank you very much!

dedeus10 commented 2 months ago

Hi Huwen. Appreciate your comment. You can find the full and original version of dataset here https://outbox.eait.uq.edu.au/uqdliu3/uqvitalsignsdataset/index.html. You are right, some cases have either missing ground truth or inaccurate values, although 34 mmHg is not impossible DBP value for a ICU patient. It is our job as researchers to create some validation for these cases. Unfortunately I can't share my final model or code, since this project became part of a company product. Happy to answer any questions and provide guidance though!

huwenfeng233 commented 2 months ago

Thank you for your response. Now I have another question. The original dataset does not include PPG signals. How did you generate PPG signals from the raw data?

dedeus10 commented 2 months ago

Hi Huwen. The original dataset does include raw PPG, it is in the same .CSV files. For each patient (case) we have several .CSV files that end with full_data_{id}.csv. These are 10 minutes annotated files with significant information, such as NBP (Sys)->SBP, NBP (Dia)->DBP and Pleth->PPG. Pleth, in this dataset, stands for Photoplethysmography (PPG)

huwenfeng233 commented 2 months ago

I'm a graduate student and I'm working on an assignment where I want to predict blood pressure from facial videos. I found some code in another repository that generates rPPG signals from videos, but the dataset I have contains PPG signals. Can I use rPPG signals instead of PPG signals for predicting blood pressure? Alternatively, do you know of any other methods that can predict blood pressure using rPPG signals? Thank you.

huwenfeng233 commented 2 months ago

When using the HeartPy package with the dataset, I encountered an error. Additionally, when I plotted the PPG signal using matplotlib, I noticed that the plot looks significantly different from the usual PPG signals. Could you please let me know what methods you used when processing the dataset?

image

image of uqvitalsignsdata/case01/fulldata/uq_vsd_case01_fulldata_01.csv

image
dedeus10 commented 2 months ago

Hi Huwen. Those libraries such heartpy, pyhrv, neurokit and others they have encapsulated logic that requires some signal quality. In the case of real-world datasets such as the Queensland dataset, the PPG signal is often noisy, has missing samples and artifacts. You can do:

  1. If you want to use hearty, segment the signal into windows of a few seconds (let's say 60s)
  2. Send the signal window to heartpy within a try/except block.
  3. If the operation fails for this window you can just discard and move to the next
  4. If the filter is successful, it means that this window has acceptable signal quality and you can use further along with the SBP/DBP reference

Another approach:

  1. Instead of using pre-built libraries, you can process the signals with your own filters
  2. For instance, for PPG I've always used the Butterworth: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html
  3. And the savitsky-golay filter https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.savgol_filter.html
  4. You can play around with the cutoff frequencies and see how it performs
  5. Be aware that Butterworth filter has phase inversion ;)