Abstract
We investigated whether machine learning (ML) analysis of ICU monitoring data incorporating volumetric capnography measurements of mean alveolar PCO2 can partition venous admixture (VenAd) into its shunt and low V/Q components without manipulating the inspired oxygen fraction (FiO2). From a 21-compartment ventilation / perfusion (V/Q) model of pulmonary blood flow we generated blood gas and mean alveolar PCO2 data in simulated scenarios with shunt values from 7.3% to 36.5% and a range of FiO2 settings, indirect calorimetry and cardiac output measurements and acid- base and hemoglobin oxygen affinity conditions. A ‘deep learning’ ML application, trained and validated solely on single FiO2 bedside monitoring data from 14,736 scenarios, then recovered shunt values in 500 test scenarios with true shunt values ‘held back’. ML shunt estimates versus true values (n = 500) produced a linear regression model with slope = 0.987, intercept = -0.001 and R2 = 0.999. Kernel density estimate and error plots confirmed close agreement. With corresponding VenAd values calculated from the same bedside data, low V/Q flow can be reported as VenAd—shunt. ML analysis of blood gas, indirect calorimetry, volumetric capnography and cardiac output measurements can quantify pulmonary oxygenation deficits as percentage shunt flow (V/Q = 0) versus percentage low V/Q flow (V/Q > 0). High fidelity reports are possible from analysis of data collected solely at the operating FiO2.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
We have previously described quantification of pulmonary gas exchange from machine learning (ML) analysis of bedside monitoring data [1]. In that study we showed by computer simulation that trained ML analysis of blood gas, indirect calorimetry, and cardiac output measurements can generate gas exchange assessments based on an adaptation of West’s ventilation/perfusion (V/Q) lung model [2, 3]. The assessments resemble multiple inert gas technique (MIGET) reports, albeit free of MIGET’s technical challenges [4, 5].
The reference methodology in this ‘scaled back’ MIGET space is the Automatic Lung Parameter Estimator (ALPE) [6,7,8,9], which analyses a similar suite of inputs. Both methods address a major limitation of the three-compartment lung model of Riley and Cournand [10, 11], which groups all oxygen transfer deficits within its shunt compartment and reports them as ‘venous admixture’ (VenAd). As highlighted previously [1], the ability to distinguish the relative influences of true shunt versus low V/Q effects in hypoxemia can influence management in conditions such as COVID-19 pneumonia [12].
Our ‘adapted West’ model enables separate quantification of these components by partitioning VenAd into ‘shunt’ and ‘low V/Q’, where low V/Q = VenAd—shunt. Both indices are expressed as percentages of pulmonary blood flow. ALPE quantifies low V/Q by a separate metric, as a notional PO2 gradient between alveolar gas and pulmonary end-capillary blood [9].
A drawback common to both methods is the need to collect data at more than one inspired oxygen fraction (FiO2), introducing potential signal distortion from absorption atelectasis and altered hypoxic pulmonary vasoconstriction [13, 14]. For high fidelity estimates the adapted West method currently requires blood gases measured at two structured FiO2 settings [1], whereas ALPE institutes as many as four FiO2 shifts for an extended series of pulse oximetry measurements [8].
It has become apparent that the ‘Two–FiO2’ requirement of our approach could be eliminated by incorporating mean alveolar PCO2 (mean PACO2), measurable at the bedside using volumetric capnography [15]. With these additional monitoring data, just one set of measurements collected at any operating FiO2 should suffice. If shown to be accurate and reproducible, this ‘Single–FiO2’ method would enable critical care practitioners to distinguish shunt from low V/Q contributions to VenAd rapidly without altering the operating FiO2.
We therefore tested the following hypotheses in silico:
-
1.
Data from blood gas analysis, indirect calorimetry, cardiac output, and volumetric capnography measurements analyzed in combination can quantify oxygenation deficits in terms of percentage shunt flow (V/Q = 0) versus percentage low V/Q flow (V/Q > 0).
-
2.
Consistent reports can be generated by ML analysis of data collected solely at the operating FiO2.
2 Materials and methods
We tested the above hypotheses through a ‘reverse engineering’ simulation.
The simulation in brief (Fig. 1).
-
1.
Using the adapted West lung model, we generated blood gas and mean PACO2 data at various FiO2 settings from simulated indirect calorimetry and cardiac output measurements across a range of shunt values, arterial hemoglobin—oxygen saturations (SaO2), and acid- base and hemoglobin oxygen affinity conditions.
-
2.
We divided these data into a training set and a test set.
-
3.
With the training set we programmed a ML application to recover shunt values solely from Single-FiO2 ‘bedside’ monitoring data.
-
4.
We then tasked the trained ML application with the ‘blinded’ recovery of the test set shunt values.
-
5.
Precise recovery of shunt values using only ‘bedside’ data would document the accuracy and reproducibility necessary for clinicians to determine shunt contributions to VenAd.
-
6.
Low V/Q contributions could then be calculated as ‘VenAd—shunt’.
2.1 The lung model
The ‘adapted West’ model currently runs via VBA sub-routines on Excel (Microsoft, Redmond, WA). Now updated to include N2 exchange, it incorporates log normal distributions of pulmonary blood flow across 20 compartments spanning a broad range of V/Q ratios, plus a separate shunt compartment (V/Q = 0). A model description including core equations is available in the Supplementary Material.
2.2 The simulation in more detail
More than 15,200 unique combinations of model inputs within pre-defined ranges (Table 1) were created by a Python program. For each combination the adapted West model generated blood gases and mean PACO2 values with the FiO2 adjusted for SaO2 ≥ 0.87 ≤ 0.98 (Table 2). As with our previous ‘Two-FiO2’ method evaluation [1], simulated scenarios encompassed a cross section of O2 consumption (VO2) and delivery, CO2 production (VCO2) and transport, hemoglobin-oxygen affinity, and respiratory and metabolic acid–base status.
The final dataset was subjected to simple randomization, then divided into a training set of 14,736 data—rows and a test set of 500 data—rows. We settled for 500 rows as the final test set rather than 10% of the total dataset (approximately 1500 rows) since these were sufficient for meaningful statistical analysis. Following ML training and validation (see below), shunt values were recovered for each test scenario (n = 500) with the true shunt values ‘held back’.
Recovery was performed solely by ML analysis of the following ten ‘bedside’ data elements: FiO2, blood hemoglobin concentration (Hb), SaO2, arterial pH, arterial oxygen tension (PaO2) arterial CO2 tension (PaCO2), mean PACO2, cardiac output, VCO2 and R (the respiratory exchange ratio VCO2/VO2). Recovered shunt estimates were then compared with their ‘true’ shunt counterparts.
2.3 ML training
[See ‘Machine (Deep) Learning terminology’ and ‘Deep Learning Model—more detail’ in Supplementary Material].
The ‘Keras’ library [16, 17] was used to construct deep learning models, each with an input layer of 10 features, plus densely connected intermediate layers and a final layer with one unit. The ReLU activation function was utilised. The optimizer was RMSprop, and the loss function was MSE (mean squared error).
The dataset was shuffled, and input features normalized. Overfitting could not be induced with increased numbers of layers, units/layer, and training epochs, consistent with a simulated dataset free from observational errors and from the inherent variation of natural phenomena.
We selected a model with six densely connected intermediate layers and 128 units/layer, resulting in 84,097 trainable parameters. The model was trained to predict shunt using 500 epochs of a dataset of 14,736 physiological records.
2.4 Sensitivity analyses
We assumed FiO2 accuracy and determined sensitivities to the remaining nine ML inputs. A representative scenario was selected in which both shunt and low V/Q blood flow contribute to a significant gas exchange deficit, as summarized by the VenAd value. The nine monitoring inputs could then be varied individually above and below their ‘true’ values while effects on VA and shunt (and therefore low V/Q, defined as VenAd—shunt) were tracked in graphic format.
This exercise was conducted using a direct (non-ML) method of model back-calculation (described in the Supplementary Material). Corresponding VenAd calculations to accompany shunt estimates were performed by application of Eq. 10 in the Supplementary Material.
2.5 Statistical methods
The data set consisted of binary pairs of actual and estimated data for shunt. To demonstrate the fit of the model, univariate regression was undertaken to assess the relationship between each estimated result and its actual partner, using the actual partner as the dependent variable. Results were reported as the regression slope, regression constant and the coefficient of determination, the R2 value. With perfect agreement between actual and estimated values, these parameters would be 1.00, 0.00 and 1.00 respectively. The 95% confidence interval and associated p-value were also reported.
Deviations of estimated from actual values were calculated and plotted as ‘estimate – actual’. Mean (SD) and median (IQR) were summarized with the data range.
A kernel density estimate (KDE) plot was also constructed. This enabled a visual representation of both the underlying distribution of the data and the accuracy of the fit of the predicted shunt values.
The level of significance was set at α < 0.05 for all relevant analyses. The statistical analysis and associated plots were undertaken using STATA™ (ver 17.0).
3 Results
Linear regression and error calculation results are set out in Tables 3 and 4, while relationships between true and estimated shunt values are illustrated graphically in Fig. 2 by KDE and error plots, along with a plot of true shunt versus estimates.
Close agreement is demonstrated. The calculated error although small, is slightly right skewed (Skewness = + 0.53) and not normally distributed (Shapiro–Wilk p < 0.001), with most occurring at Shunt < 15%. The plot of actual shunt versus shunt estimates confirms overall close agreement, while best approximating the line of identity when Shunt ≥ 15% (Fig. 2). These findings are also reflected in the adjacent error plot.
3.1 Sensitivity analysis
The nine model inputs selected for the sensitivity evaluation were:
Hb 9.30 g/dL, pH 7.364, PaCO2 39.4 mm Hg, PaO2 69.0 mm Hg, SaO2 0.94,mean PACO2 30.1 mm Hg, cardiac output 5.25 L/min, VCO2 187 mL/min, R 0.74.
At FiO2 = 0.38, model calculations produced the following estimates which determine the shunt / low V/Q split:
VenAd 18.5%
Shunt 10.8%
Responses to individual input variations are illustrated in Figs. 3, 4, 5. PaO2 and pH variation had the smallest overall effects on shunt percentage and VenAd. Each of the remaining monitoring inputs produced distinct shifts in shunt percentage. Concurrent alterations in VenAd were also evident, except with variations in PaCO2 and mean PACO2.
4 Discussion
In a computer simulation we recovered individual shunt values from 500 diverse gas exchange scenarios using a ‘Deep Learning’ ML analysis of monitoring data. The input data consisted of the operating FiO2 plus nine ‘bedside’ monitoring measurements including blood gas and mean PACO2 values created from a 21- compartment model of pulmonary blood flow. Collected without FiO2 manipulation, these were sufficient for accurate shunt recovery. Therefore unlike the ALPE method [8, 9] or our Two-FiO2 method [1], it should be possible to dispense with FiO2 ‘switching’ using this approach. Since VenAd values are calculated directly from the same data, corresponding ‘low V/Q’ components can be reported simultaneously as ‘VenAd—shunt’.
The small error increase observed at shunt values ≤ 15% is possibly a reflection of abbreviated ML training in lower shunt scenarios. Reduced scenario numbers in this region (although also at shunt values ≥ 30%) are evident in the test set KDE plot (Fig. 2). Scenario distributions in the training set are similar (plot not shown).
As with the Two-FiO2 method [1], the requisite data elements for ML analysis were sourced from blood gas, indirect calorimetry, and cardiac output measurements, but with the addition of mean PACO2 measurements by volumetric capnography. Corresponding mean PACO2 values could be calculated from the model with relatively minor adjustments. This factor prompted our selection of mean PACO2 over end-tidal PCO2, notwithstanding the promise shown by the latter measurement in severity stratification of acute respiratory distress syndrome (ARDS) [18].
Single–FiO2 quantification of gas transfer, in other words quantification without FiO2 manipulation, can be performed rapidly at the operating FiO2. There are no re-equilibration intervals, and there should be no possibility of signal distortion from absorption atelectasis [13] and altered hypoxic pulmonary vasoconstriction [14]. However, Single—FiO2 indices in current use have significant drawbacks. The difficulty with the three-compartment lung model of Riley and Cournand [10, 11] was canvassed in the Introduction, while simpler Single—FiO2 indices such as the A-a gradient and the PaO2/ FiO2 (PF) ratio are inconsistent instruments [19] providing limited information on the underlying lung pathophysiology.
‘Scaled back MIGET’ approaches such as ALPE [8, 9] and our proposed ‘adapted West’ model [1] can provide physiological detail to assist physician decision making, the focus in this case being the separate quantification of shunt and low V/Q effects [8, 12]. More generally they represent an opportunity to improve severity and prognostic stratifications, for example in ARDS [20, 21]. To date their main downside has been a requirement for Two-FiO2 [1] or even Multi–FiO2 [8, 9] data input.
We have shown in this ‘reverse engineering’ simulation that the adapted West model can function using ML at a high level of accuracy in Single–FiO2 mode provided mean PACO2 values are included in the data mix. With the advent of volumetric capnography [15], this can be accomplished without collection of expired gas in Douglas bags. The only additional requirement was incorporation of N2 exchange in the model to enable more accurate estimates of mean PACO2.
Having both shunt and low V/Q estimates expressed as percentages of pulmonary blood flow can simplify interpretation of lung pathophysiology and thereby facilitate management decisions. As discussed previously [1], a severely reduced PF ratio in a patient with ARDS typically flags extensive lung consolidation causing a large right to left shunt. Under these circumstances practitioners may initiate recruitment maneuvers, after which positive end expiratory pressure (PEEP) settings are commonly reset to maintain recruited lung regions [19].
However, identical oxygenation disturbances can occur despite well—aerated lung with minimal true shunt. For example, in COVID -19 pneumonia there may be extensive pulmonary micro—thromboses diverting mixed venous blood flow through low V/Q compartments [12, 22]. In this latter scenario recruitment maneuvers and significant PEEP manipulations are likely to be counterproductive, the priority now being limitation of lung over-distension. Based on our findings, rapid distinction between these two scenarios should be possible by ML modelling of pulmonary blood flow distribution from data collected solely at the operating FiO2.
When upgrading from Two-FiO2 to Single-FiO2 mode, volumetric capnography could simply be added to the existing input mix. Alternatively, since VCO2 measurements would then be available from two devices, volumetric capnography could replace indirect calorimetry provided an appropriate respiratory exchange ratio (R = VCO2/VO2) was also assigned. For example, R = 0.90 was the apparent approximate mean R value in a recent report of patients with ARDS [8]. However, incorrect R values reduce accuracy (Fig. 4).
Sensitivity analyses raise other caveats. In Figs. 3, 4, 5 estimated shunt / low V/Q splits are shown to be variously sensitive to the nine bedside input values. In some cases, the VenAd calculation (which then defines low V/Q as ‘VenAd—shunt’) is also altered. Of note, mean PACO2 variability can cause significant shifts. Inspection of Fig. 3 shows that a 1 mm Hg variation above or below the ‘true’ mean PACO2 value moved the estimated shunt by approximately 2% of pulmonary blood flow up or down respectively. Sensitivity may vary in other gas exchange scenarios. For example, we observed during the evaluation that mean PACO2 sensitivity is reduced when true shunt dominates the VenAd, whereas it can exceed 3% / mm Hg when low VQ flow is the primary gas exchange abnormality.
To report mean PACO2 the volumetric capnograph scans single breath waveforms to determine the geometric mid-point of Phase 3 [23]. Precise identification of Phase 3 commencement is therefore key, but can be uncertain when there are waveform abnormalities [24]. Single breath waveforms are distorted by several factors known to impact end-tidal PCO2 measurement, which include tachypnea, bronchospasm, bronchial intubation, partial airway obstruction, and ventilator ‘malfunctioning’ [24].
Considering that there are another eight inputs in addition to mean PACO2, each with measurement and biological variation, the Single—FiO2 method if introduced clinically would ideally incorporate multiple data sampling across a rolling time segment, for example the prior five minutes. It would necessitate capturing mean PACO2 values breath—to—breath, along with streamed inputs of blood gases, cardiac output, VO2 and VCO2. Continuous shunt/low V/Q updates could then be produced in close to real time with relatively minor damping.
However the only continuous blood gas device in current use is confined to pump flow measurements during cardiopulmonary bypass [25]. Continuous optode-based analyzers are no longer available for general clinical use mainly due to problems with measurement artifact [26]. That being so, snapshot blood gases with the rest in rolling format would be ‘the next best thing’. Even with a complete downgrade to snapshot inputs across the board, shunt values could be estimated by ML using both Single-FiO2 and Two-FiO2 methods [1], affording practitioners three contemporaneous shunt/low V/Q split estimates by two alternative methods.
5 Conclusion
We conclude based on computer simulations of diverse gas exchange scenarios that data collected at a single FiO2 from blood gas, indirect calorimetry, cardiac output, and volumetric capnography measurements can be used to quantify pulmonary oxygenation deficits as percentage shunt flow (V/Q = 0) versus percentage low V/Q flow (V/Q > 0). ML analysis, a game-changer for the Two-FiO2 Adapted West method [1], is now shown to perform with similar accuracy in Single-FiO2 mode, so that rapid shunt/low VQ estimates can be performed at the operating FiO2 without impacting gas transfer.
References
Morgan TJ, Langley AN, Barrett RDC, Anstey CM (2022) Pulmonary gas exchange evaluated by machine learning: a computer simulation. J Clin Monit Comput 2023;37(1):201–10
West JB. Ventilation-perfusion inequality and overall gas exchange in computer models of the lung. Respir Physiol. 1969;7(1):88–110.
West JB. State of the art: ventilation-perfusion relationships. Am Rev Respir Dis. 1977;116(5):919–43.
Wagner PD. The multiple inert gas elimination technique (MIGET). Intensive Care Med. 2008;34(6):994–1001.
Wagner PD, Laravuso RB, Uhl RR, West JB. Continuous distributions of ventilation-perfusion ratios in normal subjects breathing air and 100 per cent O2. J Clin Invest. 1974;54(1):54–68.
Rees SE, Kjaergaard S, Andreassen S, Hedenstierna G. Reproduction of MIGET retention and excretion data using a simple mathematical model of gas exchange in lung damage caused by oleic acid infusion. J Appl Physiol. 2006;101(3):826–32.
Rees SE, Kjaergaard S, Andreassen S, Hedenstierna G. Reproduction of inert gas and oxygenation data: a comparison of the MIGET and a simple model of pulmonary gas exchange. Intensive Care Med. 2010;36(12):2117–24.
Karbing DS, Panigada M, Bottino N, Spinelli E, Protti A, Rees SE, et al. Changes in shunt, ventilation/perfusion mismatch, and lung aeration with PEEP in patients with ARDS: a prospective single-arm interventional study. Crit Care. 2020;24(1):111.
Rees SE, Kjaergaard S, Perthorgaard P, Malczynski J, Toft E, Andreassen S. The automatic lung parameter estimator (ALPE) system: non-invasive estimation of pulmonary gas exchange parameters in 10–15 minutes. J Clin Monit Comput. 2002;17(1):43–52.
Riley RL, Cournand A. Analysis of factors affecting partial pressures of oxygen and carbon dioxide in gas and blood of lungs; theory. J Appl Physiol. 1951;4(2):77–101.
Riley RL, Cournand A, Donald KW. Analysis of factors affecting partial pressures of oxygen and carbon dioxide in gas and blood of lungs; methods. J Appl Physiol. 1951;4(2):102–20.
Gattinoni L, Gattarello S, Steinberg I, Busana M, Palermo P, Lazzari S, et al. COVID-19 pneumonia: pathophysiology and management. Eur Respir Rev. 2021;30:162.
Dantzker DR, Wagner PD, West JB. Proceedings: Instability of poorly ventilated lung units during oxygen breathing. J Physiol. 1974;242(2):72P.
Grant BJ, Davies EE, Jones HA, Hughes JM. Local regulation of pulmonary blood flow and ventilation-perfusion ratios in the coatimundi. J Appl Physiol. 1976;40(2):216–28.
Suarez-Sipmann F, Bohm SH, Tusman G. Volumetric capnography: the time has come. Curr Opin Crit Care. 2014;20(3):333–9.
Chollet F. Deep Learning with Python. Shelter Island, New York: Manning Publications Co; 2021.
Keras: The deep learning API. [Available from: https://keras.io/.]
Bonifazi M, Romitti F, Busana M, Palumbo MM, Steinberg I, Gattarello S, et al. End-tidal to arterial PCO2 ratio: a bedside meter of the overall gas exchanger performance. Intensive Care Med Exp. 2021;9(1):21.
Radermacher P, Maggiore SM, Mercat A. Fifty years of research in ARDS. Gas exchange in acute respiratory distress syndrome. Am J Respir Crit Care Med. 2017;196(8):964–84.
Force ADT, Ranieri VM, Rubenfeld GD, Thompson BT, Ferguson ND, Caldwell E, et al. Acute respiratory distress syndrome: the Berlin Definition. JAMA. 2012;307(23):2526–33.
Zimmerman JE, Kramer AA, McNair DS, Malila FM. Acute physiology and chronic health evaluation (APACHE) IV: hospital mortality assessment for today’s critically ill patients. Crit Care Med. 2006;34(5):1297–310.
Busana M, Giosa L, Cressoni M, Gasperetti A, Di Girolamo L, Martinelli A, et al. The impact of ventilation-perfusion inequality in COVID-19: a computational model. J Appl Physiol. 2021;130(3):865–76.
Tusman G, Sipmann FS, Borges JB, Hedenstierna G, Bohm SH. Validation of Bohr dead space measured by volumetric capnography. Intensive Care Med. 2011;37(5):870–4.
Blanch L, Romero PV, Lucangelo U. Volumetric capnography in the mechanically ventilated patient. Minerva Anestesiol. 2006;72(6):577–85.
Gelsomino S, Lorusso R, Livi U, Romagnoli S, Romano SM, Carella R, et al. Assessment of a continuous blood gas monitoring system in animals during circulatory stress. BMC Anesthesiol. 2011;11:1.
Venkatesh B. Continuous intra-arterial blood gas monitoring. Crit Care Resusc. 1999;1(2):150.
Funding
Open Access funding enabled and organized by CAUL and its Member Institutions. Project supported by Departmental Funds.
Author information
Authors and Affiliations
Contributions
TJ Morgan devised the project and wrote the main manuscript text. TJ Morgan and PH Scott wrote the Supplementary Material text. TJ Morgan and CM Anstey prepared figures 1-4. CM Anstey performed and wrote the statistical analysis. PH Scott devised and performed the final machine learning analysis. All authors reviewed and revised the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Conflict of interests
The authors declare that they have no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Morgan, T.J., Scott, P.H., Langley, A.N. et al. Single-FiO2 lung modelling with machine learning: a computer simulation incorporating volumetric capnography. J Clin Monit Comput 37, 1303–1311 (2023). https://doi.org/10.1007/s10877-023-00996-5
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10877-023-00996-5