In operating rooms around the world, one of the most feared emergencies is also one of the hardest to spot in time. Intraoperative anaphylaxis—a sudden, potentially fatal allergic reaction that strikes while a patient is under anesthesia—often announces itself only through a crash in blood pressure, a sign that can have many mundane explanations. By the time clinicians piece together the full picture, the window for effective intervention may have narrowed dramatically. Now, a team of researchers in China has shown that machine learning models, trained on the physiological signals streaming from routine operating room monitors, can flag suspected anaphylaxis just two to three minutes after blood pressure begins to fall, offering a glimpse of an algorithmic safety net for the anesthetized patient who cannot speak for themselves.
The study, published in the Journal of Medical Systems, was led by Haoran Su, Liang You, and Bailin Jiang, with Guilan Kong and Yi Feng serving as corresponding senior authors. Drawing on more than a decade of electronic medical records from Peking University People’s Hospital, the team assembled real-world physiological time series data from surgeries performed between January 1, 2011, and January 1, 2023. Their goal was deceptively simple to state but technically demanding: among patients who develop hypotension during surgery—a common event with dozens of possible causes—could a machine learn to distinguish the rare, dangerous subset whose hypotension is caused by anaphylaxis?
The rarity of the condition is precisely what has made it such a stubborn clinical problem. Perioperative anaphylaxis is estimated to occur in a small fraction of anesthetics, yet international audits, including the United Kingdom’s influential Sixth National Audit Project, have documented that such reactions carry significant mortality and are frequently misdiagnosed in the moment. Anesthetized patients cannot report itching, throat tightness, or difficulty breathing. The classic visible signs of an allergic reaction—rash, flushing, bronchospasm—may be masked by surgical drapes, anesthetic agents, and the noise of the surgical field. Meanwhile, hypotension under anesthesia is so frequent that treating every episode as anaphylaxis, with aggressive epinephrine dosing, would itself expose patients to harm. The result is a diagnostic dilemma in which hesitation and overreaction are both dangerous.
To attack this problem, the researchers extracted physiological measurements at a 10-second sampling frequency from the hospital’s electronic medical records, capturing the dense streams of vital sign data that anesthetic monitors already generate continuously. From this archive, they constructed three distinct datasets, each spanning a window from ten minutes before an episode of hypotension to a defined point after it. The datasets differed only in how long the observation window extended beyond the onset of hypotension: one minute for the first dataset, two minutes for the second, and three minutes for the third. Within each dataset, patients were divided into a positive group—those who experienced intraoperative anaphylaxis alongside their hypotension—and a negative group—those whose hypotension was not caused by an allergic reaction. The class imbalance was stark and entirely expected given the rarity of the condition: the one-, two-, and three-minute datasets contained 49, 48, and 44 positive samples, respectively, against 980, 960, and 880 negative samples.
Against this backdrop of extreme class imbalance, the team trained and compared three of the most widely used gradient- and tree-based machine learning algorithms: random forests, extreme gradient boosting (XGBoost), and categorical boosting (CatBoost). These ensemble methods, which combine the predictions of many individual decision trees, are well suited to tabular physiological data and to the kind of subtle, nonlinear interactions between vital signs that characterize the onset of anaphylaxis. Model selection was carried out using five-fold cross-validation, a technique in which the data is repeatedly partitioned so that each model is tested on data it has never seen, providing a more honest estimate of how the algorithm would perform in practice than a simple train-test split.
The results pointed consistently to CatBoost as the strongest performer, and the headline numbers are striking for a task this difficult. On the three-minute dataset—the most generous information window—the CatBoost model achieved an area under the receiver operating characteristic curve (AUROC) of 0.851, with a standard deviation of 0.082, meaning it ranked anaphylactic patients above non-anaphylactic ones roughly 85 percent of the time. The area under the precision-recall curve (AUPRC), a metric that is far more punishing in imbalanced settings, reached 0.431, with a standard deviation of 0.094—a figure that towers over the near-zero baseline expected from random guessing when positives account for fewer than five percent of cases. The model attained a sensitivity of 0.861, meaning it caught approximately 86 percent of true anaphylaxis cases, while maintaining a specificity of 0.783, correctly clearing most patients whose hypotension had other causes.
Perhaps most clinically important was the model’s performance under time pressure. On the two-minute dataset, with only 120 seconds of data after blood pressure began to fall, the CatBoost model still achieved an AUROC of 0.823 and a specificity of 0.940—meaning that when the algorithm sounded the alarm, it was very rarely a false alarm, catching 71 percent of true cases. The researchers interpret this as the core feasibility finding: the physiological signature of anaphylaxis is detectable early enough to matter, not only retrospectively. An alert arriving two to three minutes after hypotension onset gives clinicians a real chance to act—whether by administering epinephrine, adjusting anesthetic depth, or pausing the suspected trigger—before cardiovascular collapse deepens.
The technical pipeline behind these numbers reflects careful attention to the messiness of real-world clinical data. The team employed locally weighted scatterplot smoothing, or LOWESS, a nonparametric regression technique originally described by Cleveland and Devlin, to extract stable trend information from noisy vital sign streams. Feature selection was handled through recursive feature elimination, an iterative process that repeatedly trains a model and discards the least informative variables until only the most discriminative features remain. Critically, the study did not stop at raw predictive performance: the researchers applied SHAP (SHapley Additive exPlanations) analysis, a game-theoretic framework for interpreting machine learning models, to identify which physiological parameters drove the model’s decisions. This transparency matters in medicine, where a black-box alert that clinicians cannot understand is unlikely to be trusted or adopted.
The physiological variables involved in such monitoring are familiar to anyone who has spent time in an operating room: heart rate, systolic and diastolic blood pressure, peripheral oxygen saturation (SpO2), and end-tidal carbon dioxide (etCO2). The last of these deserves particular attention. Previous clinical research has identified a sudden drop in end-tidal CO2 as one of the earliest and most telling signs of anaphylaxis under anesthesia, because the massive vasodilation and capillary leak of an allergic reaction rapidly reduce venous return and pulmonary perfusion, starving the exhaled gas of carbon dioxide. Earlier studies, including work published in Anesthesiology on patients with severe post-induction hypotension, have shown that low end-tidal CO2 can help discriminate anaphylaxis from other causes of hemodynamic collapse. The machine learning approach in the new study can be understood as a systematic, multivariate extension of this clinical insight: rather than relying on a single threshold in a single parameter, the algorithm weighs the coordinated behavior of all monitored signals across time.
The study’s authors are careful about scope. The data came from a single large center over twelve years, and the number of true anaphylaxis cases—fewer than fifty in each dataset—is modest, as it inevitably must be for such a rare event. Wide standard deviations on some performance metrics, such as the sensitivity estimate on the three-minute dataset, reflect the small positive class and the variability introduced by cross-validation. External validation on data from other hospitals, and eventually prospective evaluation embedded in real-time clinical workflows, remain necessary steps before any deployment. Data availability is, for now, limited to reasonable requests to the corresponding authors, and the work was approved by the ethics committee of Peking University People’s Hospital under the Declaration of Helsinki.
Even with those caveats, the implications are considerable. Anaphylaxis under anesthesia is not rare in the way a meteor strike is rare; across thousands of operating rooms and millions of anesthetics, it accumulates into a meaningful toll of deaths and near-deaths, and studies from China, Japan, the United States, and Europe have all documented the challenge of timely recognition. The pathophysiology is well understood—massive mast cell degranulation triggering vasodilation, bronchoconstriction, and fluid shifts—but pathophysiology does not diagnose a patient; vigilance does. What this study demonstrates is that a vigilance function can, at least in part, be automated using the data streams that every modern operating room already produces, without new hardware, new sensors, or additional tests.
The researchers suggest that such models could ultimately serve as an early warning layer within anesthesia information systems, quietly analyzing the physiological time series in real time and surfacing an alert when the pattern of vital sign changes matches the fingerprint of anaphylaxis. In a field where minutes and even seconds determine outcomes, an algorithm that buys the clinical team an extra two minutes of certainty may prove to be one of the more quietly transformative applications of machine learning in perioperative medicine. The anesthetized patient, unable to say that something is wrong, may soon have an algorithm saying it for them.
Cite Scienmag News
Ophelia Keating. (September 4, 2026). Machine Learning Detects Anaphylaxis Early from Real-World Physiological Data. Scienmag. https://scienmag.com/machine-learning-detects-anaphylaxis-early-from-real-world-physiological-data/
Ophelia Keating. "Machine Learning Detects Anaphylaxis Early from Real-World Physiological Data." Scienmag, 4 September 2026, https://scienmag.com/machine-learning-detects-anaphylaxis-early-from-real-world-physiological-data/. Accessed 4 September 2026.
Ophelia Keating. "Machine Learning Detects Anaphylaxis Early from Real-World Physiological Data." Scienmag. September 4, 2026. https://scienmag.com/machine-learning-detects-anaphylaxis-early-from-real-world-physiological-data/

