Opioid addiction and overdose remain serious health concerns in the United States. Naloxone can reverse opioid overdose but requires timely intervention. Toward this goal, Nandakumar et al. converted a smartphone to detect changes in respiration that precede opioid overdose. Using sonar, the smartphone detected respiratory depression and apnea (temporary lack of breathing) in humans after self-injected drug use in a supervised injection facility. Respiratory changes during general anesthesia, which simulates opioid-induced overdose, were also detected in a clinical setting. This proof-of-concept overdose detection device is encouraging; further optimization, including integrating an alert system to notify local emergency medical services of detected overdoses, would be necessary.

Early detection and rapid intervention can prevent death from opioid overdose. At high doses, opioids (particularly fentanyl) can cause rapid cessation of breathing (apnea), hypoxemic/hypercarbic respiratory failure, and death, the physiologic sequence by which people commonly succumb from unintentional opioid overdose. We present algorithms that run on smartphones and unobtrusively detect opioid overdose events and their precursors. Our proof-of- concept contactless system converts the phone into a short-range active sonar using frequency shifts to identify respiratory depression, apnea, and gross motor movements associated with acute opioid toxicity. We develop algorithms and perform testing in two environments: (i) an approved supervised injection facility (SIF), where people self-inject illicit opioids, and (ii) the operating room (OR), where we simulate rapid, opioid-induced overdose events using routine induction of general anesthesia. In the SIF (n = 209), our system identified postinjection, opioid-induced central apnea with 96% sensitivity and 98% specificity and identified respiratory depression with 87% sensitivity and 89% specificity. These two key events commonly precede fatal opioid overdose. In the OR, our algorithm identified 19 of 20 simulated overdose events. Given the reliable reversibility of acute opioid toxicity, smartphone-enabled overdose detection coupled with the ability to alert naloxone-equipped friends and family or emergency medical services (EMS) could hold potential as a low-barrier, harm reduction intervention.

Here, we describe a contactless smartphone-based system that matches the performance of an invasive respiratory impedance monitor in identifying three critical overdose precursors: opioid-induced respiratory depression, central apnea, and simulated overdose events ( 19 , 26 , 27 ). We show that a smartphone running our application placed within 1 m of a subject can monitor the subject during the postinjection period. This is the highest risk time for a fatal overdose event and the period during which a potential overdose victim would most benefit from rapid diagnosis and resuscitation.

A mobile system that can detect opioid overdose precursors and events in real time does not currently exist because of both design and validation challenges. Existing, human-based approaches to diagnose overdose rely on medical-grade equipment or trained recognition of diagnostic signs of opioid toxicity ( 19 – 23 ). Achieving similar sensing capabilities on smartphones, without the need for medical-grade equipment, is challenging because it requires tracking physiological parameters unobtrusively and without violating participant privacy ( 24 , 25 ). In addition, validating the efficacy of any opioid toxicity system requires access to patients and data while high-risk opioid use occurs, which is difficult because this can represent a medically life-threatening situation. We overcome these challenges with an active sonar-based monitoring solution, leveraging access to two unique environments where people routinely experience overdose-related respiratory physiology without harm: (i) a legally sanctioned supervised injection facility (SIF), where people self-inject previously obtained illicit opioids under medical supervision, and (ii) the operating room (OR), during routine induction of general anesthesia.

Fatal opioid overdose remains a public health epidemic in the United States ( 1 – 6 ). Each day, 115 Americans die from opioid overdose, and data from the U.S. Centers for Disease Control and Prevention indicate that the epidemic is worsening ( 7 – 9 ). Unlike many life-threatening medical emergencies, opioid toxicity is readily reversed with rapid identification and administration of the overdose antidote naloxone or supportive respiratory care ( 10 – 13 ). Thus, a fundamental challenge of fatal opioid overdose events is that victims die alone or among untrained or impaired bystanders, with insufficient timely diagnosis and treatment ( 14 ). To help connect potential overdose victims with widely available life-saving interventions, we developed algorithms for commodity smartphones that unobtrusively recognize opioid overdose by its physiologic precursors. Our software system, which runs as an application on smartphones, converts the phone into a short-range active sonar system using frequency shifts to identify respiratory depression, apnea, and gross motor movements associated with acute opioid toxicity. By creating overdose detection algorithms that can be used on devices that most high-risk individuals already own ( 15 , 16 ), we hope to provide a harm reduction system that can automatically connect with naloxone-equipped friends and family or emergency medical services (EMS) to help prevent fatal overdose events ( 17 , 18 ).

We recruited for 35 instances of simulated overdose (34 unique participants): Data from 15 patients were used as a development set to generate the algorithm, and 20 were used as an evaluation set to validate algorithm performance. Results from the evaluation cohort are presented ( Table 1 and Fig. 5B ). In the evaluation set, as expected, all 20 patients experienced true overdose physiology, characterized by postinjection loss of consciousness and diminished or absent breathing. Our algorithm identified 19 of the 20 simulated overdoses as having disordered breathing. Of the 19 correctly identified patients, 18 patients experienced sustained apnea (terminated per protocol after 30 s), and 1 patient had severely diminished breathing that the algorithm identified as an overdose. The one patient who was incorrectly classified had a breathing signal just above the algorithm’s threshold. In each case where the algorithm correctly identified the overdose event, it detected the onset of respiratory failure similarly to the real-time reference standard ( Fig. 5B ). We note that specificity is not meaningful in this environment because all participants experience the simulated overdose event (all patients undergoing induction of general anesthesia lose consciousness and experience depressed breathing) ( 41 ).

( A ) Illustration of OR setup. The phone is placed within 1 m of the patient on a surgical (Mayo) stand. A respiratory impedance monitor is fitted around the patient’s chest to measure the true respiratory rate and apnea status. Healthy participants wearing all standard OR monitors have general anesthesia induced. ( B ) Comparison of time to detection of simulated overdose based on algorithm-identified respiratory failure onset (smartphone) versus real-time detection by the reference standard.

A key limitation of the SIF environment is the limited occurrences of overdose events requiring clinical resuscitation. To address this, we deployed our system in the OR. This controlled environment allowed us to safely simulate the worst-case scenario of acute opioid toxicity: immediate loss of consciousness coupled with respiratory depression that would be fatal or critically morbid without intervention. Such conditions are safely reproduced during routine induction of general anesthesia ( Fig. 5A ) when patients receive fentanyl and other anesthetic drugs.

Figure 4A shows the distribution of the number of central apnea events per participant, as identified by our system. Forty-five of the 94 participants (48%) had no central apnea events, all of whom had no interventions by staff. Among those who experienced a postinjection central apnea event, 71% had one to two central apnea events during the 5-min postinjection monitoring period. Figure 4B is a histogram of the durations of these central apnea events. The plot shows that 66% of central apnea events were ≤20 s in duration. We also note that both overdosed participants had a central apnea event of at least 30 s before clinical intervention.

( A ) Overview of experimental sequence. Testing was performed in an SIF (InSite). ( B and C ) Sensitivity and specificity for respiratory depression (RD) and central apnea events (CAE). ( D ) Postinjection respiratory rate on a smartphone versus reference standard. ( E ) Postinjection central apnea event detection on a smartphone versus reference standard. ( F to I ) Smartphone breathing signals (amplitude over time) of four subjects whom InSite staff physically checked on after injection. (F) Overdose: Subject exhibits multiple central apnea periods, followed by deep breath. (G) Overdose: Subject exhibits respiratory depression with an average respiratory rate of four breaths per minute. (H) Intervention: Subject exhibits central apnea, is aroused by staff, and becomes agitated. (I) Intervention: Subject slouches after injection and staff physically check on patient, whose breathing does not meet respiratory depression or central apnea thresholds.

We recruited participants over 209 self-injection instances (194 unique participants): 115 injection events were used as a development set, and 94 were used as an evaluation set to measure algorithm performance ( Table 1 ). Sixty-four participants (68%) reported using heroin, 19% reported using fentanyl, and 13% reported using morphine or hydromorphone. After injection, 83 participants (88.3%) experienced a decrease in respiratory rate during the monitored postinjection period (fig. S2); 47 participants (50%) experienced clinically important respiratory depression; 49 participants (52%) experienced at least one postinjection central apnea event; and 8 participants (8.5%) had a manual intervention by clinical staff, of which 2 participants (2.3%) experienced an overdose event requiring clinical resuscitation (oxygen, bag-mask ventilation, and/or naloxone therapy). Both overdosed participants were successfully resuscitated by the clinical staff without issue.

We deployed our system in Vancouver, BC, within an approved SIF. Although our primary targeted algorithm user is a person who uses opioids when alone (the demographic at highest risk for fatal overdose), we chose the SIF environment because it facilitates safe, real-world testing and algorithm development based on actual opioid self-injection events. Acute, life-threatening overdose events requiring medical intervention remain relatively uncommon in this environment, occurring in less than 1% of opioid use events (about 500 supervised injections occur per day in the facility) ( 38 ). Therefore, our primary outcomes of interest were postinjection central apnea (cessation of breathing for 10 s or longer) ( 27 ) and opioid-induced respiratory depression (respiratory rate ≤7 breaths per minute) ( 39 , 40 ), both of which are necessary precursors to lethal opioid intoxication events.

The system was evaluated across ( A ) different smartphone models, ( B ) orientations of the smartphone, ( C ) various positions of the smartphone with respect to (w.r.t.) the subject, ( D ) in the presence of interference from another nearby moving subject, ( E ) with environmental noise from devices placed 75 cm from the subject, ( F ) as a function of distance from the smartphone, and ( G ) recalibration accuracy after the subject changes the orientation of the phone, as well as slouches. ( H ) The fraction of time the subject’s respiration and other motion was captured by the algorithm in the SIF deployment. Individual data for benchmark testing are reported in table S2.

We developed algorithms that address these challenges. Our algorithm uses FMCW to disambiguate the reflections at different distances from the smartphone, the resolution of which is about 0.7 cm with a typical microphone sampling rate of 48 kHz. Thus, the algorithm can separate the subject’s breathing signal from other movements in the environment that occur at a different distance (for example, those of an opioid-using companion). In addition, by tracking the distance corresponding to the subject’s breathing signal, the algorithm automatically recalibrates when a posture change occurs or when the subject or phone changes position. Figure 2 demonstrates benchmark performance across phone models (Galaxy S4, S5, S6, iPhone 5S, Google Pixel, and Nexus), phone orientations, subject distance and posture, and various environmental noise and motion conditions.

Our system builds from previous work using active sonar to detect sleep apnea ( 28 ); however, the opioid use case differs from the sleep environment in several fundamental ways. First, breathing motion is diminished during opioid use, which can complicate respiratory peak detection. In addition, subjects may be under the influence of opioids when they initiate a subsequent use event and thus may have a diminished breathing signal at that time. Unlike the sleep laboratory used in previous work, which is a controlled environment with a lone subject who is primarily stationary, subjects using opioids may have increased motion that can affect the time delay of the echo, may engage in high-risk opioid use behaviors in the presence of others, and are generally in a much less-controlled environment, which introduces other sources of potential interference ( 35 , 36 ). The SIF where our experiments were performed is a highly dynamic and stimulating environment; recording devices are prohibited within the SIF, but the environment can be observed in a public domain report ( 37 ). For example, there are routinely several people around; there is talking among clients; staff and clients walk around; overhead music plays; and occasionally, personal dogs are within the environment. In addition, there is climate control equipment and a special indoor ventilation system (to remove the smoke from heroin preparation), all of which produce ambient noise. In short, there are several environmental elements in the high-risk opioid use domain that differ from the controlled setting of a sleep laboratory.

( A ) Schematic of device operation. The smartphone’s speaker transmits an inaudible, custom FMCW signal (red arrow), which is reflected by the subject (blue-dashed arrow) and recorded using the smartphone’s microphone. ( B ) The reflections arrive at time delays ∆t i and ∆t e during inhalation and exhalation; the changes translate to unique frequency shifts ∆f i and ∆f e . ( C ) The frequency shifts can be estimated by taking an FFT over 15 chirps; the breathing signal is found in a frequency bin corresponding to the subject’s distance from the smartphone. Motion in the environment from a different distance would appear at a different frequency bin and hence can be separated.

Our system uses frequency-modulated continuous waveform (FMCW) and converts the smartphone’s native speaker and microphone into a short-range active sonar system ( 28 – 34 ) that allows for portable measurement of chest motion and respiration using inaudible acoustic signals. The phone continuously transmits a custom, inaudible, FMCW where the transmitted frequency increases linearly with time between 18 and 22 kHz within a duration of 10 ms ( Fig. 1 , A and B). These custom acoustic signals reflect off a surface (in this case, a moving chest during respiration), and the echo arrives back to the smartphone’s microphones after a time delay, ∆t, corresponding to the distance of the reflector from the smartphone. The time delay (∆t) is given by 2 d v s , where d is the distance of the human body from the smartphone and v s is the speed of sound in air. When the subject’s chest moves because of breathing, the distance (d) to the smartphone and the corresponding time delay of its echo (∆t) at the microphone change. Because the frequency of the FMCW signals increases linearly over time, each of their time delays (∆t) translates to a unique frequency shift (∆f) in the reflected signals. Hence, we can measure the changing distances due to breathing motion by observing the frequency shift caused by the echo over time. The periodicity of the changes generates sinusoidal waves, the peaks of which correspond to a complete breathing cycle ( Fig. 1C ). A peak detection algorithm then identifies the maximum amplitude of the wave, which enables determination of a subject’s respiratory rate and the presence of apnea.

In summary, we developed a proof-of-concept system that can be implemented on commodity smartphones and can identify simulated and real-world opioid overdose events and their precursors. As a harm reduction intervention, such a system could connect people experiencing potentially fatal overdose events with known life-saving interventions (naloxone-equipped friends, family, shelter personnel, or EMS) in real time. As the number of deaths attributable to opioid overdose continues to rise, new strategies are needed to help mitigate the risk of death and disability from this public health epidemic. One key tool to reverse these events is naloxone, which is increasingly available to first responders (including police) and to people through take-home naloxone programs and is now endorsed by the U.S. government ( 49 ). In addition to its use by EMS providers, the administration of naloxone by trained friends and family has been shown to be a safe and effective means of reversing overdose ( 13 , 50 ). However, neither EMS, friends, nor family can intervene with naloxone or supportive respiratory care in an emergency if they are not immediately aware that an overdose is taking place. Noninvasive self-monitoring via smartphone, as we have described, could address this critical shortcoming and may represent an easily accessible strategy to help keep people safe until they are able to access long-term treatment.

Another potential concern is whether the system could reliably alert prehospital EMS providers in a time frame that enables successful resuscitation with naloxone or supportive respiratory care. On the basis of historical data from Seattle, King County, involving fatal overdose events and average EMS response times, we believe that a meaningful EMS integration is possible (fig. S1). Such a program would need to incorporate the detection algorithm’s performance characteristics to leverage the operations and resources of a given EMS system. Any integrated program must also acknowledge that, even with rapid connection to EMS, victims could still experience morbidity and mortality after opioid overdose ( 48 ).

Our study has several limitations. Healthy participants recruited for the OR experiments are likely different from the eventual intended user population. We chose this healthy population in the OR setting for reasons of safety and algorithm development for the worst-case scenario of acute opioid overdose (which is safely reproduced in an OR environment). External validity was addressed by testing in the SIF with participants who are more likely to use the application as it is eventually intended. It is beyond the scope of this study to seek and recruit subjects who use high-risk opioids alone or to conduct our study procedures in a participant’s personal environment outside of the InSite facility. In addition, development of a harm reduction intervention does not ensure adoption and use. For harm reduction interventions to be efficacious, further studies with participant feedback and human factor testing are needed to ensure that the system meets the needs, values, and preferences of people who use opioids, in addition to establishing the system’s safety vis-à-vis its potential to encourage moral hazard. Other harm reduction interventions such as take-home naloxone programs have been found not to increase risky behavior or lead to adverse health consequences ( 42 – 44 ). Previous data on harm reduction interventions show that people are willing to engage in behaviors to help keep themselves safe, such as using needle exchanges, take-home naloxone, face shields for mouth-to-mouth respiratory support, and SIFs ( 45 – 47 ).

Here, we used a commodity smartphone to run an algorithm to identify opioid overdose precursors. Overdose events are readily reversible with early detection. In the setting of real-world, high-risk opioid use, our results highlight the need for a multitiered interactive phone-based alarm system that escalates or de-escalates based on user feedback. We do not envision the phone-based system alerting a third party or disturbing the user based on an isolated central apnea or respiratory depression event; rather, an alert should be sent only after a subject is unable to respond to a stimulus from the phone after a sustained central apnea or respiratory depression event, representing a potentially life-threatening overdose. Evaluating such a multitiered system would be the next step in enabling an end-to-end overdose detection system using commodity smartphones.

MATERIALS AND METHODS

Study design We investigated the accuracy of a smartphone-based software system for identifying opioid-induced respiratory depression, central apnea, and simulated overdose events. Ground truth (gold standard) measurements were taken with a respiratory impedance monitor. In both the SIF and the OR, a development set was used to develop the algorithm and an evaluation set was used to prospectively evaluate algorithm performance. To demonstrate feasibility, we chose to stop recruitment after >200 instances of illicit opioid self-injection. In the OR, because the algorithm was highly sensitive in detecting sustained apnea after induction of general anesthesia, we did not pursue beyond 35 participants. Randomization was not applicable, and investigators were not blinded. All participants provided informed consent, and the studies were approved by the University of Washington Institutional Review Board (IRB), the University of British Columbia Office of Research Ethics, and the Vancouver Coastal Health (VCH) Ethics Services (VCH operates the SIF, InSite).

Active sonar detection of breathing signals Our system transmits FMCW signals and analyzes the frequency shifts resulting from human motion. The frequency shift, from which the respiratory rate is derived, was determined by performing a fast Fourier transform (FFT). We chose an FMCW chirp period of 10 ms, which gives a frequency resolution of 100 Hz. The unique challenge with opioids acting on the central nervous system is that breathing motion can be severely depressed. For our FMCW signal with a 4-kHz bandwidth, this minute motion can translate to a frequency shift less than 8.33 Hz. To extract this, we perform an FFT over 15 consecutive chirps, which linearly increases the frequency resolution to 6.66 Hz and thus captures even severely depressed breathing motion, down to a chest movement of 0.7 cm. By taking an FFT over 15 chirps, any high-frequency motion within this duration is averaged and hence lost. However, because the average breathing rate of human subjects is less than 20 breaths per minute, which is a relatively low-frequency motion, no breathing motion is lost within the 150-ms FFT duration. To extract the breathing signal, the algorithm first estimates the distance of the person’s chest from the smartphone over time. The breathing signal is present in a unique frequency bin corresponding to this distance. To identify this bin, the algorithm starts by looking from the 18-kHz bin (corresponding to distance zero, directly in front of the phone) and proceeds to 18.320 kHz (corresponding to a distance of 1 m away from the phone). For each bin, it examines changes in the power value over a duration of 30 s by performing a second FFT over it. If a peak between 0.5 and 0.7 Hz (the typical breathing frequency of a human) is observed, then that bin corresponds to the breathing signal. Therefore, the second FFT occurs until the bin that corresponds to the breathing signal is found. In the worst-case scenario, the system may iterate through 48 bins before isolating the breathing signal. Once found, the signal recurs within the same bin as long as the subject remains in place. However, when a subject moves, the bin corresponding to the distance has a motion signal instead of breathing. In this scenario, the system reinitiates the search for the new bin containing the breathing signal. In particular, if the distance of the subject from the smartphone changes, then we estimate the new distance by computing the bin corresponding to the breathing after the motion.

Detecting opioid-induced depressed breathing Breathing motion is diminished when people use opioids. To overcome this, we make two changes to the peak detection algorithm. First, to remove any small motion noise, we run the data through a bandpass decimating Cascaded integrated comb filter. The filter removes any motion noise higher than a frequency of 1 Hz and also decimates the signal by a factor of 2. Second, we collect a baseline breathing signal for a duration of 1 min before the self-injection event. From the baseline collection period, the algorithm calculates the subject’s average peak amplitude, peak prominence, and average peak distance. These parameters are used to identify the peaks during postinjection monitoring. For the baseline signal, the algorithm leverages the periodicity of the breathing signal and the frequency limits of the breathing signal (less than 20 breaths per minute) to estimate breathing peak parameters. Specifically, only peaks that are separated by a minimum of 20 samples (corresponding to a maximum breathing rate of 20 breaths per minute) are considered. During postinjection monitoring, we combine this condition along with the average peak parameters that we estimated in the first step. Peaks separated by a minimum of 20 samples that have an amplitude of at least 50% of the baseline and 30% of the peak prominence are classified as breathing peaks. If the number of peaks is less than or equal to seven, then the epoch is marked as a respiratory depression event. If the distance between the peaks is greater than 10 s, then we mark a central apnea event. If the number of breaths in the epoch is at least greater than three, then we update peak amplitude, peak prominence, and distance values with the combined average of new peak values. If a specific peak is twice as great as the average peak values, then the system does not use that peak in average peak parameter computations.

Differentiating breathing from motion Because subjects’ faces and hands are close to their chests and are about at the same distance from the smartphone, the change caused by motions of these body parts can be added to the breathing signal in its frequency bin during the primary algorithm’s FFT operation. Moreover, this motion has higher amplitude compared to the more subdued breathing motion and can overpower the breathing signal, making it difficult to extract the breathing motion. Although such motion noise would typically be problematic, the presence of motion provides additional information about the subject. Specifically, sustained motion indicates that the subject is active and not overdosed. Similarly, motion that is followed by breathing indicates that the subject is active and thus not overdosed. On the other hand, motion within the operational range that is followed by an absence of breathing likely indicates an overdose scenario. Hence, we modify the algorithm to differentiate between a signal corresponding to periodic, low-frequency breathing motion and one that belongs to high-frequency body motion, which is aperiodic and high amplitude. We identify this by looking at the peaks in the second FFT operation of the 30-s signal corresponding to each bin. If the peaks have higher frequencies and an amplitude at least twice that of the breathing frequency peaks, then the instance is classified as a motion epoch. If the motion is absent or present only for a few seconds, then the algorithm considers it to be a breathing signal and processes it to identify the respiration rate.

Distance recalibration When we encounter a motion epoch, the distance of the subject with respect to the smartphone can change. Hence, after every motion epoch, we need to run the recalibration step to detect the frequency bin that corresponds to the new distance of the subject from the smartphone. When we encounter the first motion epoch, we set the motion bit to 1 and examine the next epochs. For subsequent epochs, we search all the nearby FFT bins until we detect the bin that has the breathing signal. We then use this new bin for the next set of epochs until we see the next motion epoch. For the first breathing epoch after the motion epoch, we update the peak parameter values to the average values of the new epoch corresponding to the new distance of the subject. To review, we first filter the recorded signal using a high-pass filter to remove audible environmental noise. We then split the data into 30-s epochs and run the distance estimation step described above on the first epoch to identify the bin that contains the breathing signal. We estimate average breathing peak amplitude, peak distance, and average peak prominence for this epoch. For subsequent epochs, we check the same frequency bin in the distance estimation algorithm. If it contains the breathing signal, then we use the previously estimated amplitude and prominence values to determine the breathing peaks in this epoch and subsequently update them with the new peaks of the current epoch. This continues until the bin contains a motion signal instead of breathing signal. If the subsequent epoch does not contain the breathing signal and instead contains the motion signal (high amplitudes, more peaks), then we mark it as a motion epoch and run the recalibration step for the subsequent epochs until we find the new breathing signal.

Suppressing environmental motion High-risk opioid use commonly occurs as a group activity, which introduces another source of potential interference (35, 36). In this case, the interfering subject’s breathing or motion may change the received echoes at the smartphone. However, because the interfering subjects will mostly be located at different distances with respect to the smartphone, their breathing motions (as determined by the primary FFT operation) would occur at different frequency bins than that of the subject of interest. Assuming that the smartphone is closest to the intended subject, namely, within 1 m, the first frequency bin containing the breathing signal likely corresponds to the breathing motion of the intended subject. The algorithm therefore filters out any breathing detected at farther distances.

Computational complexity In the worst case, our algorithm performs 54 FFT computations per second and one linear peak estimation algorithm. Such operations can each be computed within tens of milliseconds on an off-the-shelf smartphone (51, 52). This delay is within the expected human response time (for visual overdose identification) of a few seconds. Last, on the basis of the duration of high-risk opioid self-injection events, we expect the application to run for less than 45 min per day and not more than 15 min per event. The algorithm’s computations along with the sensor data collection consume 6 to 18% of a phone’s battery power for this duration. In addition, most fatal overdose events occur within a private residence, hotel, or motel (53), which should have an available power source.

Vancouver SIF Participants. All people who inject opioids and use the SIF, who were over 18 years old, and had capacity to provide informed consent (as determined by InSite staff) were eligible for study inclusion. People under the age of 18 and impaired individuals were not eligible (per SIF protocol, severely impaired individuals are assisted and are unable to use the facility). Potential participants were identified at the time they checked into the SIF for the purposes of supervised opioid self-injection and were approached by a research assistant for informed consent. Participants were approached consecutively after check-in into the facility. Participants were given a coffee gift card worth $5 for participation. Measures. We computed the breathing rate to identify respiratory depression and central apnea occurrences, both of which can indicate or precede a fatal opioid overdose. We defined a breathing rate of ≤7 breaths per minute to be a respiratory depression event, and the absence of breathing for 10 s or longer to be an opioid-induced central apnea event. We chose a respiratory rate of ≤7 breaths per minute because the Agency for Healthcare Research and Quality has found this respiratory rate to be sufficiently dangerous to recommend as a trigger for a hospital’s rapid response system (39, 40). The U.S. Food and Drug Administration (FDA) defines an apnea event as cessation of breathing for 10 s or longer and requires FDA-approved apnea devices to detect this threshold (27). Protocol. Clients, who consented obtained sterile injecting equipment per routine, were assigned to a monitored injection stall and were asked to prepare their drugs as they normally would. Monitored stalls were equipped with a dedicated off-the-shelf phone with our preinstalled app, which was placed on the tabletop. All subjects, regardless of participation, received standard clinical monitoring by the SIF clinical staff according to institutional protocols. Postinjection overdose detection by staff was defined by standard institutional triggers listed (table S1). Notably, routine staff monitoring relies on visual monitoring for acute clinical distress and does not involve active respiratory monitoring equipment. Once participants had prepared their equipment and drugs, they were fitted with a respiratory impedance monitor for reference standard monitoring. Then, the participants were asked to remain seated and breathe normally for 1 min to establish a baseline respiratory rate. A Galaxy S4 smartphone, placed within 1 m of the participant on the injection stall table, began respiratory monitoring at the initiation of the 1-min baseline measurement (Fig. 3A). Participants then self-injected opioids and monitoring continued for 5 min. We chose 5 min because this represents the critical period when an acute overdose would occur; from a pharmacology perspective, fentanyl reaches a peak plasma concentration within 3 to 5 min and more than 80% of the injected dose leaves the plasma by 5 min (54). If an overdose event occurred, or a participant was in a clinical state sufficiently concerning that a trained medical staff member walked over to check on a patient, then it was recorded by the research assistant and counted as an intervention event. As we note in the main text, there were eight instances where a staff member checked on a participant after injection out of concern for their clinical state. In the six instances (including the two reversed overdoses) where the respiratory impedance monitor identified disordered breathing, the algorithm identified respiratory depression or central apnea in all six. In the two other instances, the subjects had fallen asleep and slouched in their chairs after injection; however, both had respiratory patterns that did not meet the respiratory depression or central apnea thresholds (the smartphone and respiratory impedance monitor correctly identified normal breathing, wheareas the staff misclassified potential clinical distress, although appropriately checked on the patient).

Operating room To optimize surgical conditions, patients are routinely given fentanyl and other potent drugs immediately before surgery to purposefully induce apnea. The physiologic equivalent of drug overdose occurs each time a patient undergoes general anesthesia; however, patients are unharmed by this induced “overdose” because of their supraphysiologic oxygen stores and the timely ventilatory support that the anesthesiologist provides. Therefore, anesthetizing a patient in the OR offers a unique way to safely simulate an otherwise lethal overdose event (characterized by unconsciousness and diminished or absent breathing) induced by fentanyl and other opioids. Healthy patients free of cardiopulmonary disease, aged 18 to 55 and scheduled for elective surgery, were eligible for the OR study and were approached on the day of surgery. Participants were given an Amazon gift card worth $50 for participation. Once inside the OR, patients were fitted with standard anesthesiology cardiopulmonary monitors: pulse oximeter (Nellcor OxiMax, Medtronic), blood pressure cuff (NovaPlus, Welch Allyn), and 5-lead electrocardiogram (Philips IntelliVue). In addition to the standard anesthesiology monitors, participants were fitted with a Vernier respiratory belt to provide reference standard respiratory monitoring. The smartphone (Galaxy S4) was placed on a surgical stand ≤1 m away at about chest level (Fig. 5A). Next, the clinical team conducted their standard OR preinduction safety procedures (safety surgical and preanesthesia checklists). The ventilation mask was affixed to the patient with a strap. OR personnel were asked to stand away from the patient; the attending anesthesiologist was beside the patient and immediately available. Next, per standard anesthetic procedure, the participant breathed 100% oxygen for 3 to 5 min until their expired oxygen stores were greater than 85%—a threshold deemed safe to administer induction doses of anesthetic agents to induce apnea (55). This standard preoxygenation procedure allows the body to be safely apneic without having the oxygen saturation fall to unsafe levels during apnea periods that may persist for as long as 7 min under normal conditions (56). The attending anesthesiologist then administered induction doses of fentanyl and propofol in doses at his/her discretion for standard induction of general anesthesia (the average fentanyl dose was 1.4 μg/kg; the average propofol dose was 2.9 mg/kg). The attending anesthesiologist announced the moment when the patient had become apneic, at which time a timer was started. The timekeeper announced the elapsing time in 10-s intervals until 30 s was reached [we chose 30 s of apnea as a suitably safe period for a preoxygenated individual to be completely apneic before intervention (56) and termination of the protocol]. At 30 s, the protocol was officially over, at which point the anesthesiology team assumed control of the airway (administered a neuromuscular blocking agent, if indicated) and provided manual ventilation and inserted an endotracheal tube or laryngeal mask airway. No neuromuscular blocking agents were administered during the protocol. Once the participant’s airway was secured and it was deemed safe by the clinical team, the study team removed the research equipment and exited the OR. As per the IRB protocol, the attending anesthesiologist could intervene at any moment and for any reason during the protocol should the patient require intervention. Breaking protocol was in no cases required during the study because all patients safely tolerated the procedure.