Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 237 lines · 8.7 KB · no license
- import util.psh_util as psh_util
- import es_based_detector as eb
- import pandas as pd
- import numpy as np
- import sys
- def es_based_process(labelled_case, ground_truth_annotations, patients_list_file, fileserver_path):
- # get raw vital HR (spo2r) from mat file
- #url1 = '/trend/1_trend.mat'
- url1 = labelled_case
- spo2r1 = psh_util.create_vital_from_url(url1, 'SPO2r')
- # get annotations (ground truth), label only from Auton viewer
- #ground_truth = pd.read_csv('/data/all_annotations_GT.csv')
- ground_truth = pd.read_csv(ground_truth_annotations)
- p1_annotations = ground_truth[ground_truth.project_id == 9]
- # all annotations, magic number = 1675827557.07 for converting timestamp from viewer to proper epoch
- spo2r_int = psh_util.create_annotation_intervals(p1_annotations, 1675827557.07)
- # get annotations on raw trend data
- gt_all, gt_index_all = psh_util.create_time_interval_for_GT(spo2r1, spo2r_int)
- ogt_all, ogt_index_all = psh_util.create_time_interval_outside_GT(spo2r1, spo2r_int)
- # extract features for model training
- outside_features = psh_util.extract_feature_from_outside_interval(spo2r1, 'SPO2r', spo2r_int)
- inside_features = psh_util.extract_feature_from_interval(spo2r1, 'SPO2r', spo2r_int)
- # stat features
- feature_list = ['mean', 'std', 'var', 'min', 'max', 'median']
- # getting patient ids
- patient_list = pd.read_csv(patients_list_file)
- patient_ids = patient_list['pid'].unique()
- all_patient_meta = []
- for i in patient_ids:
- cur_pair = [int(i), patient_list[patient_list['pid'] == i].iloc[-1]['case_control']]
- all_patient_meta.append(cur_pair)
- all_patient_meta_pd = pd.DataFrame(all_patient_meta, columns=['record_id', 'PSH_status'])
- # label window size: 10 min (300 datapoints)
- window_length = 300
- #############################
- ## Combine analysis result ##
- #############################
- all_pd = []
- for i in range(len(all_patient_meta_pd)):
- pid = int(all_patient_meta_pd.iloc[i].record_id)
- if np.isnan(all_patient_meta_pd.iloc[i].PSH_status):
- psh_status = 0
- else:
- psh_status = int(all_patient_meta_pd.iloc[i].PSH_status)
- #psh_status = int(all_patient_meta_pd.iloc[i].PSH_status)
- print('current id: '+str(pid))
- print('PSH status: '+str(psh_status))
- '''
- Part I. create intervals
- '''
- # create the driver vital: SPO2r
- url = fileserver_path+str(pid)+'_trend.mat'
- cur_hr = psh_util.create_vital_from_url(url, 'SPO2r')
- # modify min rule
- min_rule = min_rule + 10
- # create labelled interval on min, std, and median
- min_interval, min_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, min_rule, 'min')
- std_interval, std_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, std_rule, 'std')
- median_interval, median_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, median_rule, 'median')
- # combine all intervals
- print('min len: '+str(len(min_interval))+', std len: '+str(len(std_interval))+', md len: '+str(len(median_interval)))
- combined = []
- combined.extend(min_interval)
- combined.extend(std_interval)
- combined.extend(median_interval)
- # merge overlapping intervals
- merged = eb.merge(combined)
- print('merged len: '+str(len(merged)))
- # filter with short intervals, use threshold 230
- filtered = []
- for s, e in merged:
- if e-s > 230:
- filtered.append([s,e])
- print('filtered len: '+str(len(filtered)))
- # convert to a time intervals
- time_intervals = eb.convert_index_time(cur_hr, filtered)
- # create trajectory
- '''
- Part II: get confidence scores
- '''
- # get other vitals
- # blood presure
- cur_nbps = psh_util.create_vital_from_url(url, 'NBPS')
- # RR
- cur_resp = psh_util.create_vital_from_url(url, 'RESP')
- # tmp1
- cur_tmp1 = psh_util.create_vital_from_url(url, 'TMP1')
- # tmp2
- cur_tmp2 = psh_util.create_vital_from_url(url, 'TMP2')
- # get confidence lists from NBPS and RESP
- # use 4 hours before/after each episode
- nbps_diff = eb.calculate_confidence_bp(cur_nbps, 'NBPS', time_intervals, 4)
- resp_diff = eb.calculate_confidence_bp(cur_resp, 'RESP', time_intervals, 4)
- # based on the list, calculate the actual score
- nbps_scores = eb.get_score_from_list(nbps_diff)
- resp_scores = eb.get_score_from_list(resp_diff)
- # get confidence lists from tmp1 and tmp2
- # use 38 degree as the threshold
- t1_percent = eb.calculate_confidence_tmp(cur_tmp1, 'TMP1', time_intervals, 38)
- t2_percent = eb.calculate_confidence_tmp(cur_tmp2, 'TMP2', time_intervals, 38)
- '''
- Part III: combine everything together into csv
- '''
- length = len(time_intervals)
- # all current ids
- id_lst = length*[pid]
- # psh status list
- psh_lst = length*[psh_status]
- start_time_lst = []
- end_time_lst = []
- start_index_lst = []
- end_index_lst = []
- duration = []
- nbps_diff_lst = []
- nbps_score_lst = []
- resp_diff_lst = []
- resp_score_lst = []
- tmp1_percent_lst = []
- tmp1_score_lst = []
- tmp2_percent_lst = []
- tmp2_score_lst = []
- for s_index, e_index in filtered:
- start_index_lst.append(s_index)
- end_index_lst.append(e_index)
- for idx, time_pair in enumerate(time_intervals):
- start_time_lst.append(time_pair[0])
- end_time_lst.append(time_pair[1])
- duration.append(time_pair[1]-time_pair[0])
- # adding nbps differences and score
- if idx in nbps_diff:
- nbps_diff_lst.append(nbps_diff[idx])
- nbps_score_lst.append(nbps_scores[idx])
- else:
- nbps_diff_lst.append(np.nan)
- nbps_score_lst.append(np.nan)
- # adding resp differences and score
- if idx in resp_diff:
- resp_diff_lst.append(resp_diff[idx])
- resp_score_lst.append(resp_scores[idx])
- else:
- resp_diff_lst.append(np.nan)
- resp_score_lst.append(np.nan)
- # adding tmp1 precentage and score
- if idx in t1_percent:
- tmp1_percent_lst.append(t1_percent[idx])
- if t1_percent[idx] > 0.5:
- tmp1_score_lst.append(1)
- else:
- tmp1_score_lst.append(0)
- else:
- tmp1_percent_lst.append(np.nan)
- tmp1_score_lst.append(np.nan)
- # adding tmp2 precentage and score
- if idx in t2_percent:
- tmp2_percent_lst.append(t2_percent[idx])
- if t2_percent[idx] > 0.5:
- tmp2_score_lst.append(1)
- else:
- tmp2_score_lst.append(0)
- else:
- tmp2_percent_lst.append(np.nan)
- tmp2_score_lst.append(np.nan)
- cur_interval_pd = pd.DataFrame({'id': id_lst, 'PSH': psh_lst, 'start_time': start_time_lst, 'end_time': end_time_lst,
- 'start_index': start_index_lst, 'end_index': end_index_lst,
- 'duration(sec)': duration,
- 'NBSP_values': nbps_diff_lst, 'NBSP_scores': nbps_score_lst,
- 'RESP_values': resp_diff_lst, 'RESP_scores': resp_score_lst,
- 'TMP1_percent': tmp1_percent_lst, 'TMP1_score': tmp1_score_lst,
- 'TMP2_percent': tmp2_percent_lst, 'TMP2_score': tmp2_score_lst})
- file_name = str(pid)+'_intervals.csv'
- #cur_interval_pd.to_csv(file_name, index=False)
- all_pd.append(cur_interval_pd)
- print('-----------------------')
- final_pd_4 = pd.concat(all_pd)
- final_pd_4.to_csv('updated_rule_all_patients_score_4hour_window.csv', index=False)
- print('complete!')
- def main():
- print('Labelled Cases File Path: ', sys.argv[1])
- print('Ground Truth File Path: ', sys.argv[2])
- print('All Patients List: ', sys.argv[3])
- print('All Other Cases Path: ', sys.argv[4])
- es_based_process(labelled_case=sys.argv[1], ground_truth_annotations=sys.argv[2], patients_list_file=sys.argv[3], fileserver_path=sys.argv[4])
- if __name__ == "__main__":
- main()
es_based_analysis.py at commit 26a46d7, no license · at the source
Overview
- University of Maryland, Baltimore, United States of America
- University of Maryland, School of Medicine, United States of America
Abstract
Paroxysmal sympathetic hyperactivity (PSH) is a syndrome that occurs in a large subset of critically ill traumatic brain injury (TBI) patients and is associated with complications and poor recovery. PSH is defined by recurrent episodic vital sign elevations in the appropriate clinical context. However, standard diagnostic criteria rely heavily on subjective judgment, leading to challenges and delays in recognition, monitoring, and management. The objective of this study was to develop automated PSH detection and quantification tools that exclusively utilize objective bedside continuous vital sign data. Using a cohort of 221 critically ill acute TBI patients with at least 14 days of continuous physiologic data (of which 107 were clinically diagnosed with PSH) we developed a high-resolution clinical feature scale based on established PSH-Assessment Measure criteria and two artificial intelligence-based episode detection models including an expert system approach and a machine learning model approach, using a clinician-annotated case example as ground truth. For the episode detection methods, PSH was quantified as the number, duration, and overall temporal burden of detected episodes. To evaluate performance, we compared quantifications across PSH cases and controls and explored precision and recall. All three methods demonstrated initial face validity to delineate PSH cases from non-PSH TBI controls. Future optimization and implementation of the described computational frameworks with real-time patient data could improve the standard monitoring and management of this challenging clinical syndrome.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
seankong88/PSH_episode_analysis
26a46d7b38b184a2b9af431566742aaefc195921, 26 December 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
7 files
- es_based_analysis.py, Python, 237 lines
- es_based_detector.py, Python, 371 lines
- model_based_analysis.py, Python, 72 lines
- model_based_detector.py, Python, 366 lines
- util/
precision_recall_ts_util , Python, 216 lines.py - util/
psh_util.py , Python, 202 lines - README.md, Text, 71 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 6 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability
We provide de-identified data as supporting files, and we also provide author-generated code at the following url: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 9 MeSH terms, 1 funder, 18 references.
Cite
This paper
Kong, X., Chen, L. K., Chowdhurry, S. H., Felix, R. B., Yang, S., Hu, P., Badjatia, N., & Podell, J. E. (2026). Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients. PloS one, 21(3), e0344088. https://
BibTeX
@article{kong2026computa
author = {Kong, Xiangxiang and Chen, Lujie Karen and Chowdhurry, Sancharee Hom and Felix, Ryan B and Yang, Shiming and Hu, Peter and Badjatia, Neeraj and Podell, Jamie Erin},
title = {{Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients}},
journal = {PloS one},
year = {2026},
month = mar,
volume = {21},
number = {3},
pages = {e0344088},
publisher = {PLOS},
issn = {1932-6203},
doi = {10.1371/
url = {https://
pmid = {41774715},
pmcid = {PMC12956124}
}
RIS
TY - JOUR
AU - Kong, Xiangxiang
AU - Chen, Lujie Karen
AU - Chowdhurry, Sancharee Hom
AU - Felix, Ryan B
AU - Yang, Shiming
AU - Hu, Peter
AU - Badjatia, Neeraj
AU - Podell, Jamie Erin
TI - Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients
T2 - PloS one
J2 - PLoS One
PY - 2026
DA - 2026/
VL - 21
IS - 3
SP - e0344088
SN - 1932-6203
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients",
"container-title": "PloS one",
"author": [
{
"family": "Kong",
"given": "Xiangxiang"
},
{
"family": "Chen",
"given": "Lujie Karen"
},
{
"family": "Chowdhurry",
"given": "Sancharee Hom"
},
{
"family": "Felix",
"given": "Ryan B"
},
{
"family": "Yang",
"given": "Shiming"
},
{
"family": "Hu",
"given": "Peter"
},
{
"family": "Badjatia",
"given": "Neeraj"
},
{
"family": "Podell",
"given": "Jamie Erin"
}
],
"container-title-short":
"volume": "21",
"issue": "3",
"page": "e0344088",
"DOI": "10.1371/
"PMID": "41774715",
"PMCID": "PMC12956124",
"ISSN": "1932-6203",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
3
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pone.0345651 [code]
- Non-concussive head impacts sustained during American football correlate with changes in gut microbiome diversity and composition.Journal: PloS oneIn common: seaborn, scikit-learn, pandas, 3 other tools, traumatic brain injury, clinical / translational
- [2] doi:10.1186/s12974-026-03890-4 [code]
- Neuronal toll-like receptor-4 regulation of matrix metalloproteinase-9 activity mediates dentate circuit dysfunction after traumatic brain injury.Journal: Journal of neuroinflammationIn common: seaborn, scikit-learn, pandas, 3 other tools, traumatic brain injury
- [3] doi:10.1002/hbm.70534 [code]
- Longitudinal Multimodal Neuroimaging After Traumatic Brain Injury.Journal: Human brain mappingIn common: seaborn, pandas, SciPy, 2 other tools, traumatic brain injury, clinical / translational
- [4] doi:10.1038/s41598-026-47942-4 [code]
- CT-based radiomic markers to predict late-onset seizures after traumatic brain injury.Journal: Scientific reportsIn common: scikit-learn, pandas, SciPy, 2 other tools, traumatic brain injury, clinical / translational
- [5] doi:10.1093/braincomms/fcag123 [code]
- Traumatic brain injury recovery prediction by harmonizing real brain CT and synthetic brain MRI: a pilot study.Journal: Brain communicationsIn common: scikit-learn, pandas, SciPy, 2 other tools, traumatic brain injury
- [6] doi:10.1093/braincomms/fcag145 [code]
- GABA&
lt;sub& gt;A& lt;/ sub& gt; binding correlates with high-frequency EEG: a possible proxy for depolarization in traumatic brain injury. Journal: Brain communicationsIn common: pandas, SciPy, Matplotlib, 1 other tool, traumatic brain injury - [7] doi:10.1007/s00429-026-03166-w [code]
- Autoencoders for unsupervised analysis of rat myeloarchitecture.Journal: Brain structure & functionIn common: scikit-learn, SciPy, Matplotlib, 1 other tool, traumatic brain injury
- [8] doi:10.1016/j.ynirp.2026.100377 [code]
- Accelerated brain aging in Veterans with posttraumatic stress symptoms and mild traumatic brain injury.Journal: Neuroimage. ReportsIn common: scikit-learn, pandas, NumPy, traumatic brain injury, clinical / translational
- [9] doi:10.1136/tsaco-2025-001974 [code]
- Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank.Journal: Trauma surgery & acute care openIn common: scikit-learn, pandas, NumPy, traumatic brain injury, clinical / translational
- [10] doi:10.1002/adhm.202503457 [code]
- A 3D Human Neuron-on-Chip Platform to Monitor Neuronal Injury Responses.Journal: Advanced healthcare materialsIn common: traumatic brain injury, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 6 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:4f9751e1c5422402…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
