andy-phung

Untitled

Dec 22nd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. **Training Data Collection and Processing**
  2. ecg-data-collection.ino:
  3. - sample the serial output of the ad8232 (which is just a signal conditioner) for five seconds at ???(200/400?)hz,
  4. - convert serial output to .txt over USB with putty
  5.  
  6. - convert the .txt file to multiple .tsv files
  7. data generation:
  8. - use the christov r-peaks detector to generate a list of r-peaks
  9. - calculate ibi
  10. - calculate sympathetic and parasympathetic power
  11. - calculate SDNN
  12. - repeat for all samples
  13. - cluster into two clusters with k-means (sympathetic and parasympathetic power)
  14. - calculate distance from baseline centroid for all data points
  15. - if the point is in the cluster for detected anxiety, then multiply by a weight, which is determined by the anxiety cluster centroid's distance from the baseline cluster's centroid
  16. - anxiety index = normalize to a float between 0 and 1 -> {weighted distance + difference between baseline SDNN and SDNN}, where the weighted distance comprises 75% of the index, while the difference between the baseline SDNN and SDNN comprises 25% of the index
  17.  
  18. todo:
  19. - implement error handling in all programs
  20. - anxiety index gen implementation (ensure that the program can loop through all uploaded .tsv files and generate an index for each of them)
  21. - hardware setup + putty setup + delete all test variables and files
  22. - actual data collection
  23. - change all test variables in all algorithms
  24. - pass the data through to obtain x-y pairs
  25. - convert all tsv files to csv files for easier data management when training?
  26. - implement a load_dataset() function (loads the x-y pairs as numpy arrays)m
  27.  
  28. issues:
  29. - ad8232 sampling rate
  30. - tflite support for artemis
  31.  
  32. (e0103.tsv)
  33. Low Frequency Power (Sympathetic): 0.6927324238837926
  34. High Frequency Power (Parasympathetic): 0.0008289976394698316
  35. Parameters: [0.69273242 0.000829 ]
  36.  
  37. (e0110.tsv)
  38. Low Frequency Power (Sympathetic): 0.6927322301682437 <-
  39. High Frequency Power (Parasympathetic): 0.0008293845888830577 <- extremely subtle differences
  40. Parameters: [0.69273223 0.00082938]
  41.  
  42. Distance list: [4.3273035749211477e-07, 0.0, 7.15861207908303e-07]
  43. Weighted distance list: [4.327306060073341e-07, 0.0, 7.158616190243757e-07]
  44. Pre-index: 5.569940729620437
  45. Pre-index: 2.0
  46. Pre-index: -17.749491096196778
  47. Anxiety Index (0): 2.227976291848175
  48. Anxiety Index (1): 0.8
  49. Anxiety Index (2): -7.099796438478711
  50.  
  51. ecg0: [0.6927324238837926, 0.0008289976394698316]
  52. SDNN: 11.04285415915946
  53. ecg1: [0.6927322301682437, 0.0008293845888830577]
  54. SDNN: 14.61279445604929
  55. ecg2: [0.6927325506297615, 0.0008287444625794123]
  56. SDNN: 34.36228626810769
Advertisement
Add Comment
Please, Sign In to add comment