key: cord-0950440-e3o5uqxc authors: Radhakrishnan, Sita; Nair, Suresh G.; Isaac, Johney title: Multilayer perceptron neural network model development for mechanical ventilator parameters prediction by real time system learning date: 2021-09-20 journal: Biomed Signal Process Control DOI: 10.1016/j.bspc.2021.103170 sha: b9a4d5a46bce3edca938e5695deccfdb5fe2700d doc_id: 950440 cord_uid: e3o5uqxc BACKGROUND AND OBJECTIVE: In pandemic situations like COVID 19, real time monitoring of patient condition and continuous delivery of inspired oxygen can be made possible only through artificial intelligence-based system modeling. Even now manual control of mechanical ventilator parameters is continuing despite the ever-increasing number of patients in critical epidemic conditions. Here a suggestive multi-layer perceptron neural network model is developed to predict the level of inspired oxygen delivered by the mechanical ventilator along with mode and positive end expiratory pressure (PEEP) changes for reducing the effort of health care professionals. METHODS: The artificial neural network model is developed by Python programming using real time data. Parameter identification for model inputs and outputs is done by in corporating consistent real time patient data including periodical arterial blood gas analysis, continuous pulse oximetry readings and mechanical ventilator settings using statistical pairwise analysis using R programming. RESULTS: Mean square error values and R values of the model are calculated and found to be an average of 0.093 and 0.81 respectively for various data sets. Accuracy loss will be in good fit with validation loss for a comparable number of epochs. CONCLUSIONS: Comparison of the model output is undertaken with physician’s prediction using statistical analysis and shows an accuracy error of 4.11 percentages which is permissible for a good predictive system. Controlling critical human parameters using artificial intelligence may contribute to reduce human effort in COVID-19 like pandemic situations. Shortness of breath is one of the serious symptoms of Corona and hence people suffering from COVID-19, who develop acute respiratory distress syndrome, have to be mechanically ventilated. Mechanical ventilator is a lifesaving machine that supplies oxygen into the body of the patient and removes carbon dioxide from the body. Training medical staff to handle ventilators is a high-risk job since all the actions are related with human life. Even now the ventilator parameters including inspired oxygen level (FiO 2 ), ventilator modes, positive end expiratory pressure (PEEP) etc. are adjusted two or three times a day only manually by the health care professionals. Continuous monitoring and keep up of blood oxygen saturation level (SpO 2 ) within the range of 95 to 100 percent, by stipulated delivery of FiO 2 using artificial neural network (ANN) lessens the effort of medical practitioners during their busy hours. Only automation of mechanical ventilators could match the patient oxygen necessity in real time preferably by reducing the time lag that caused via manual adjustment. Physicians refer arterial blood gas analysis and pulse oxymetry readings to decide the stipulated amount of inspired oxygen. Under normal physiological conditions, the variation of critical blood gas parameters like pH, partial pressure of carbon dioxide PCO 2 , partial pressure of oxygen PO 2 , bicarbonate HCO 3 , haemoglobin Hb, in arterial blood gas (ABG) analyses depends on inspired oxygen input. For example, pH value in blood gas analysis became less than 7.35 lead to metabolic acidosis which negatively affect the patient. Hence it must be between kept between the range 7.35 and 7.45. Also, PaO 2 = 5*FiO 2 , that means a patient breathing 40% oxygen should have a PaO 2 of 200 mmHg. Along with that PCO 2 was placed normal between the range 35 mmHg and 45 mmHg. More over HCO 3 must is kept almost between 20 mmol/L and 28 mmol/L. Also, Hb must be kept between the range of 12 to 17 g/dL. All these parameters can be controlled with in desired limits only by the injection of preferred amount of inspired oxygen by controlling various mechanical ventilator parameters. In our previous papers fuzzy logic model was used for FiO 2 prediction [1] and classification model using weighted KNN (K nearest neighbours) was used for ventilator mode prediction [2] . In these two papers we used only one prediction that is inspired oxygen in the former and ventilator modes in the latter. Here we are using multi-layer perceptron (MLP) artificial neural network (ANN) models for prediction of inspired oxygen along with respective mechanical ventilator modes and PEEP [3] [4] [5] . The method of breath supply and the type of breath used in ventilators establishes the different ventilator modes. Hence it must be properly set with corresponding PEEP and FiO 2 . Statistical methods like pair wise analysis of real patient data is used for input and output parameter identification for developing decisive ANN model. Pair wise comparison is used for deciding which all parameters are correlated with a particular parameter (FiO 2 ) in pairs. This comparison helps us to identify the relative importance of a number of options and is commonly used when the priorities given are vague in nature and when the performance of comparison is done for multiple data sets [6] . In this work we have developed multilayer perceptron model (MLP) using Python programming, to predict inspired oxygen along with corresponding mechanical ventilator modes and PEEP. Comparison between the MLP model and physicians' prediction was also done. The following sections are organized as Section II Literature review, Section III Methodology used that discusses Data Collection, statistical pair wise analysis and development of ANN model by Python programming, Section IV illustrates Results and Discussions about the work and finally the Section V shows Conclusion and Future Work. Varieties of ANN models were used in medical field to predict and control human parameters. For developing our MLP model a wide literature review was under taken. In this section we can discuss some of the works related with artificial intelligence models in biomedical field and also works related with mechanical ventilator automation. By studying the advantages and lacuna in literature the MLP model was developed for mechanical ventilator parameter prediction. Davenport. T and Kalakota. R gave a brief description of the importance of artificial intelligence in health care and its pros and cons in their paper in 2019 [7] . They discussed almost all the techniques in soft computing like neural networks, fuzzy modeling etc. Chatburn, Robert L [8] explained various control techniques for ventilator mode control including control using artificial neural network. N.L. Loo et al. developed convolution neural network for AB detection by collecting data from ventilated patients. But this method was only used for identifying the events, as it was not suitable for classification as well as calculation of magnitude [9] . S.M. Analin developed a nonlinear predictive control using neural net for spontaneous breathing. Nevertheless, modeling of biological system here was not patient specific and yet under improvement. The lacuna was that the system developed was only predictive and it must be modified further for intensive care applications [10] . GP Gupta et al. developed an ANN for predicting the blood oxygen saturation value. But it is only a predictive system for SpO 2 of patients in ventilator [11] . Pan et al. proposed transfer learning to identify patient ventilator asynchrony by changing convolution neural network models. But the convolution of one dimensional time series into images having a unique size distorted the wave forms at different lengths [12] . Alkurawy Lafta EJ designed a SpO 2 controller of infants using neural network modeling and mathematical modeling and compared its performance in 2019. But here the performance of neural network was low since the number of data set used for modeling the system was very low [13] . Fathabadi et al. proposed a paper estimating the parameters affecting the transfer function that gave the connection between FiO 2 and SpO 2 in infants. In this work parameter classification was done using ANN. The main lacuna was that since this was a transfer function model it did not project the dynamic changes of the system behaviour [14] . Mamandipoor. et al. developed predictive machine learning models including recurrent neural network models for predicting the chance of patient dying in mechanical ventilator by analysing mechanical ventilator parameters. But it was only a retrospective study showing no specific rule for the collection of ventilation parameters [15] . Perchiazzi. G used animal data developing models using ANNs and multilinear fitting methods for calculating respiratory system compliance. It was not applied in humans under ventilator and was under test [16] . Nikhil Bhagwat et.al predicted scores on the Alzheimer's disease Assessment Scale using artificial neural network. But the author itself states that there is lack of parameter interpretability which forbids localising some brain region prediction [17] . Weaning difficulty prediction was done by Hsieh et.al in 2019 using ANN. The model was under construction by using differing data [18] . Kuo et al. developed an ANN based decision support system for extubation decision systems. But the system was not a generalized one; it functioned well only in the concerned institution where the study had undertaken [19] .Kwong et.al proposed a study that shows the effectiveness of machine learning in weaning process decision making. The study clearly said that more work was needed to develop a model which was more patient specific [20] . Mueller et al. proposed a decision support tool using various machine learning techniques to predict the extubation time of infants from mechanical ventilator [21] . Decaro et al. compared the results of ANN and support vector machine, for prediction of oxygen saturation. It is said that only small amount data was used here for model creation so further modification was going on. This is only a predictive system and some machine learning techniques here shows poor performance [22] . So many study related with deep neural networks were also under taking in biomedical research field but the main limitation was the availability of large amount of real time data [23] [24] [25] . In this work we have applied Python programming platform for the development of multi-layer perceptron artificial neural network model. Python is a high-level general purpose open-source language with large standard library in free of cost. We had chosen Python environment because of its productive, flexible, dynamic and free open-source nature since we were developing the model with so many iterations with variety of physiological data. By continuous evaluation of the data samples collected some conclusions about the blood gas parameters were reached by manual study and also by statistical analysis. In this paper continuous SaO 2 reading from pulse oximetry was in corporated with intermittent ABG parameters. Data sets that match the set values of PEEP, inspired oxygen and ventilator modes were taken for modelling the MLP system using Python programming. The below figure Fig. 1shows the procedure for model development. The work flow includes data collection of confidential patient data for machine learning, cleaning of data by statistical pair wise analysis, model development using Python Programming, validation of the model and comparison of the model output with doctors' prediction. Below sections clearly illustrates each and every part of the work flow chart. Data collection which is the most relevant step for machine learning process, since system modelling is done by analysing, training, validation and testing of cleaned data. Real data set of adults suffering from acute respiratory syndrome were collected which contains arterial blood gas (ABG) analysis, pulse oximetry readings (SaO 2 ) and mechanical ventilator settings with ethical consent from concerned authorities during the period from December 2017 to June 2020. The data set includes vitals of a ventilated patient including heart rate, temperature, blood pressure, pulse rate, respiration rate, blood oxygen saturation rate from pulse oximetry (SaO 2 ), arterial blood gas readings and mechanical ventilator settings including positive end-expiratory pressure (PEEP), Rate, Minute volumes, FiO 2 etc. Maximum possible patient data were collected and data cleaning was done. Sample size calculation is given below: • Number of patients = N • If one patient is under respiratory assistance for three days and if the data is measured in 1-hour interval • The data sample collected for one patient for 3 days 24*3 = 72 data sets. • If N = 200 patients are considered, Sample size = 72*200 = 14,400 data sets From this raw data set, parameters affecting the oxygen saturation level were estimated by consultation with physicians and respiratory therapists [1] . Commonly physicians are concentrating on ABG values and the real time continuously monitored SpO 2 values for adjusting ventilator parameters. Using statistical analysis using R programming correlation of each vitals with inspired oxygen were considered. The data showing wide range of outliers were not considered. The mostly effected physiological parameters by inspired oxygen input were considered for modelling the system. Scattered plots of each and every parameter collected including vitals were plotted against inspired oxygen using R programming for getting its the relationship between inspired oxygen. From the plots we could find out that pH of blood, partial pressure of carbon dioxide in blood (PaCO 2 ), bicarbonate (HCO 3 ), partial fraction of oxygen (PaO 2 ) and haemoglobin (Hb) from ABG analysis and SaO 2 readings of pulse oximetry were mostly correlated to FiO 2 . Along Y axis FiO 2 was taken and along X axis each blood gas parameters were taken, see Fig. 2 that displays scatter plot of FiO 2 verses pH, Fig 0. 3 that shows scatter plot of FiO 2 verses Hb, Fig. 4 for FiO 2 verses PCO 2 , Fig. 5 for FiO 2 verses HCO 3 , Fig. 6 that displays FiO 2 verses PO 2 and Fig. 7 that shows FiO 2 verses SpO 2 . Pair wise analysis representing FiO 2 verses pH, PCO 2 , PO 2 , HCO 3, Hb and SaO 2 is displayed in Fig. 8 . The pair wise analysis scatter plot shows symmetric comparisons one in the upper right triangle and other in the lower right triangle. This analysis of multiple parameters disclosed how every element is preferred, or has some element shows any quantitative property. This analysis shows the effect of increase or decrease of FiO 2 with respect to the six blood gas parameters discussed above. The plot for FiO 2 verses pH is explained as pH value varies from 7.1 to 7.7 corresponding to the FiO 2 values from 40 to 100. Also, for example when pH becomes less than 7.3, FiO 2 have to be increased. Correspondingly all the variables with respect to FiO 2 were plotted. And hence we can see that PCO 2 above 35 mmHg was risky and FiO 2 must increase. Similarly, PO 2 below 80 mmHg is dangerous; we have to increase FiO 2 . We can see HCO 3 decreased below 21 mmol/L, then FiO 2 has to be increased. When Hb is decreased below12 g/dL, we must increase FiO 2 . Analysing pulse oximetry readings, it was found that we must increase FiO 2 if the reading goes below 98 %. After statistical analysis other than PO 2 , PCO 2 , pH, HCO 3 , Hb, SaO 2 all other physiological parameters were neglected since these were proved to be the most varying parameters with the influence of FiO 2 . Changing inspired oxygen along with other ventilator parameters like ventilator modes, PEEP needs high accuracy since it is a lifesaving process. Here we incorporate the output regression value of inspired oxygen with different classification modes of mechanical ventilator. Positive end expiratory pressure (PEEP) was also set as one of the output parameters. Hence the predicted values here was the amount of inspired oxygen along with the corresponding ventilator mode and PEEP. We are considering the ventilator modes like Average volumeassured pressure support (AVAPS), Bi-level Positive Airway Pressure (BIPAP), Continuous positive airway pressure ventilation with pressure support (CPAP/PS), Assist Control modes involving pressure Control (ACPC), Assist Control modes involving volume control (ACVC) and Synchronised Intermittent Mandatory Ventilation with volume control (SIMVVC). They are represented in numbers from 1 to 6for converting its classification nature into regression. The below Table 1 shows the input and output selected for system modelling after parameter identification using statistical analysis. Artificial neural network usually works like a decision support system for mechanical ventilation medical automation research. ANN mimics human brain and uses data for learning situations to produce better predictions. Usually ANN consists of three layers, input, output and the hidden layer [26] . In our network there are six inputs and three outputs. The six inputs include PO 2 , PCO 2 , pH, HCO 3 , Hb, SaO 2 and the output parameters are FiO 2 , PEEP and modes of ventilation. We can choose necessary hidden layers to improve the performance of ANN network. A multilayer perceptron network using python programming was developed. Python can be used to analyse large set of data which is highly diverse. It is an open-source language and is flexible for wide variety of health care applications. The model was first developed using only five input parameters excluding Hb. In that case the accuracy of the model was very poor and hence we included Hb also as an input parameter for modelling the system. So many trial and error methods of training the MLP model was trained for 50 times varying the number of hidden layers and the number of nodes in hidden layers were done with variety of data sets for modelling the system for getting maximum performance. The number of nodes or neurons in the input layer is equal to the six parameters in the selected data that corresponds to PO 2 , PCO 2 , pH, HCO 3 , Hb, SaO 2 . Linear activation function was used here for both the hidden and output layers since suggested output must be a value or number as regression analysis was considered. The output layer consists of three nodes corresponding to FiO 2 , PEEP and ventilator modes. Here hidden layers and its nodes were created by trial-and-error method concerning the performance of the model. We constructed three hidden layers in which the first one comprised of 15 nodes, the second had 20 nodes and the third one contained 15 nodes. The summary of the multilayer perceptron neural network python model for multiple output prediction is integrated in Fig. 9 . We had developed a number of multi-layer perceptron models by trial and error with different hidden layers and different number of neurons and compared them for getting better result. Linear activation function was chosen for each neuron for the reason that regression analysis was done here for getting the output figure of inspired oxygen as a single value or in digit. The performance of MLP models with one hidden layer, two hidden layers and three hidden layers with different number of nodes were compared. See Table 2 showing the values of the mean square error (MSE), R value of the trained model and percentage accuracy error of the ANN models with different hidden layers. From the table we could understand that the model with 3 hidden layers showed better performance. Hence that MLP model having three hidden layers in which first one with 15 nodes, second with 20 nodes and the third with 15 nodes was chosen. The total parameters used are seven hundred and seventy-eight. The mean square error and R value calculated for the MLP model with 3 hidden layers was 0.093.R and 0.81 respectively. The model efficiency is detected by testing with different data sets and the percentage accuracy error is found to be 4.11 percentage, Fig. 10 represents the accuracy loss and validation loss that were decreasing at higher epochs [27, 28] . Fig. 11 shows the percentage accuracy error of the system when compared with the inspired oxygen prediction of the physicians for different data samples. Calculating the percentage accuracy error using the clinician's accepted values and the predicted value using the equation, The accuracy error of the ANN model was found to be 4.11% and we can increase accuracy by huge amount of data since python programming needs huge amount of data set for good performance. Statistical comparison by Analysis of Variance (ANOVA) using R programming was done for comparing the multilayer perceptron model (M) output with three doctors' predicted values-D1, D2 and D3using a sample of 20 patients' data, given in Table 3 [29] . The result of ANOVA test is given in Fig. 12 and the box plot for comparing mean is displayed in Fig. 13 . From that we can see that the p value is 0.9925 and the mean of the predicted output is within the acceptable range. The explanation of analysis is as follows: Here the null hypothesis is that H_0: there is no significant difference in the measured data within the groups. Alternative hypothesis is: H_1: there is a significant difference in the measured data within the groups. One-way ANOVA test is conducted on the sample of size 20. Since the p-value greater than 0.05, the null hypothesis is accepted. So it is statistically reasonable to conclude that there is no significant difference in the mean measure over the three doctors' diagnosis and the model output. So on an average the model output is at par with experts' findings. Hence the proposed model is statistically acceptable. Hence forth in default we can say this model can be used as suggestive system to support physicians and other health workers during pandemic conditions where ventilated patient number increases unpredictably. We can compare our research with the works of others in the similar field. Pan et.al discussed the miss match between patient needs and ventilator assistance using neural network [30] . In that work a convolutional one-dimensional neural network was developed to detect different patient ventilator asynchrony (PVA). The lacuna was that here only the study related the detection of four types of PVA was undertaken and no automation was undertaken. In our work real time patient readings were taken for matching the patient need with ventilator assistance. Gazalet. al. developed a model using ANN which predict blood oxygen saturation(SpO 2 ) after changing ventilator settings. In this work poor classification was occurred due to small data set in which PEEP and other ventilator settings were not considered. So, they were trying to modify the work by increasing the parameters [31] .M.Stierset. al proposed a study proposed a study showing the safety details of ventilator settings when it is used in shared condition if its need increases in pandemic condition like COVID-19 [32] . Here for limiting tidal volume, PEEP and FiO 2 a flow restrictor is used. They used bench testing to evaluate failures in the developing stage and were not able to determine intrinsic PEEP for ventilator settings. Comparing with above two papers we can conclude saying that we had considered PEEP and ventilator modes along with inspired oxygen prediction. C Tams et.al recommended an advisory model for non-invasive ventilation for inspired oxygen. But the author itself said that the work needs to be improved by removing the limitations in controlling ventilator parameters since the study was done only with inspiratory positive air way pressure (IPAP), expiratory positive airway pressure (EPAP) and FiO 2 [33] . In our study six common ventilator modes were taken along with FiO 2 . Bikker et al. studied lung pathology of mechanically ventilated patient at different PEEP for measuring end expiratory lung volume. Here patients with PEEP of 20 cm H 2 O were not included and the data set taken also was too low. Also leak compensation technique was not properly carried out and it was a single site implementation study [34] . We have taken variety of data sets for model development. Karbing et al. developed a clinical decision support system (CDSS) for appropriate ventilator changes. The study only considered incremental PEEP and only short-term advice of CDSS was taken [35] . Comparing all the above works and also by statistical ANOVA test we can say that our paper is unique in combining real time continuous pulse oximetry readings with intermittent ABG readings for developing an MLP network for FiO 2 Fig. 11 . % Accuracy error of MODEL. prediction along with PEEP and ventilator modes with very low error. The major limitation of the study is the difficulty in getting variety of data sets. The model was developed with small data set and if we could use big data set for modelling we can improve the performance of the system. Also it works only as a suggestive system and work is going on to extend its capacity to control inspired oxygen delivery in real time. A combination of medical and engineering effort is needed for setting ventilator parameters to maintain blood oxygen saturation of patients during pandemic situations. For that artificial intelligence-based monitoring and control of inspired oxygen level is very crucial in mechanically ventilated patients. We developed a multilayer perceptron model using open-source programming, Python for predicting mechanical ventilator settings. Arterial blood gas readings and corresponding pulse oximetry readings were considered for modelling the system for controlling mechanical ventilator settings like inspired oxygen output, PEEP and modes of ventilation. The parameter identification for choosing the inputs and outputs of the ANN model was carried by using pair wise analysis in R programming statistical tool. Scatter plots for various blood oxygen parameters were compared with FiO 2 for getting the most correlated parameters. The accuracy of the model was found to be greater than 75%. Different MLP models with changing hidden layers were compared and the best model with three hidden layers was taken. Statistical ANOVA test was done for performance analysis of the system comparing with the physician's' suggestions concluding that the model was statistically acceptable with less than 5% accuracy error for working as suggestive a system intended to supporting health care professionals. Also, in future we are planning to develop neural network models combining tidal volume, pressure support and respiratory rate. Our aim is to develop a model using deep neural network for mechanical ventilator automation including more input and output parameters using big data set. Overall, all authors contributed equally for the preparation of this manuscript. There is no funding for the authors to state. The data is highly confidential and collected with ethical approval and available with corresponding author. The work described has not been published before and is not under consideration for publication elsewhere. Analysis of parameters affecting bloodoxygen saturation and modeling of fuzzy logic system for inspired oxygen prediction Predicting Ventilator Modes to maintain Blood Oxygen Saturation of Post Surgical Patients Within Desired Limit Using Weighted KNN Classification Algorithm Prediction of prolonged ventilation after coronary artery bypass grafting: data from an artificial neural network Maung Ning Wan, Md Kamrul Hasan, Prediction of disease level using multilayer perceptron of artificial neural network for patient monitoring Use of a multilayer perceptron to create a prediction model for dressing independence in a small sample at a single facility An extension on statistical comparisons of classifiers over multiple data sets for all pairwise comparisons The potential for artificial intelligence in healthcare Computer control of mechanical ventilation Mat-Nor, A machine learning model for real-time asynchronous breathing monitoring Nonlinear model predictive control with neural network optimization for mechanical ventilation of critical care patients An ANN based SpO2 measurement for clinical management systems Identifying patient-ventilator asynchrony on a small dataset using image-based transfer learning Neural network and control for arterial oxygen saturation in neonatal infants Assessment of validity and predictability of the FiO 2 -SpO 2 transferfunction in preterm infants Machine learning predicts mortality based on analysis of ventilation parameters of critically ill patients: multi-centre validation Robustness of two different methods of monitoring respiratory system compliance during mechanical ventilation Alzheimer's Disease Neuroimaging Initiative, An artificial neural network model for clinical score prediction in Alzheimer disease using structural neuroimaging measures Predicting weaning difficulty for planned extubation patients with an artificial neural network Improvement in the prediction of ventilator weaning outcomes by an artificial neural network in a medical ICU The efficacy and effectiveness of machine learning for weaning in mechanically ventilated patients at the intensive care unit: a systematic review Can machine learning methods predict extubation outcome in premature infants as well as clinicians? Machine learning approach for prediction of hematic parameters in hemodialysis patients Two-step deep neural network for segmentation of deep white matter hyperintensities in migraineurs, Computer methods and programs in biomedicine White blood cells identification system based on convolutional deep neural learning networks NiftyNet: a deep-learning platform for medical imaging Artificial neural networks advantages and disadvantages Applications of Deep Learning in Healthcare and Biomedicine Classification using deep learning neural networks for brain tumors Statistical methods and common problems in medical or biomedical science research An interpretable 1D convolutional neural network for detecting patient-ventilator asynchrony in mechanical ventilation Using machine learning models to predict oxygen saturation following ventilator support adjustment in critically ill children: A single center pilot study Individualized mechanical ventilation in a shared ventilator setting: limits, safety and technical details Clinical decision support recommending ventilator settings during noninvasive ventilation Diederik Gommers, End-expiratory lung volume during mechanical ventilation: a comparison with reference values and the effect of positive end-expiratory pressure in intensive care unit patients with different lung conditions An open-loop, physiologic model-based decision support system can provide appropriate ventilator settings All authors gave consent for publication in this journal The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.