Design and Simulation of a Physician-Based Fuzzy System for Ventilator Adjustments in ARDS Patients to Ensure Lung Protection

Te acute respiratory distress syndrome patients largely need a mechanical ventilator intervention. Tere are procedures that have been developed to guide the physicians during the ventilation of the patient. Berlin defnition of the acute respiratory distress syndrome has been developed with ventilator adjustment settings/procedures. Te procedures may however be a challenge for some physicians to remember during the intense ventilator intervention. Physicians are found to make human errors that may lead to the death of the patient. Tis, therefore, calls for the need of a logic system that will reason for the physician, that is, guide the physician. A fuzzy logic system was used to build the fuzzy set rules based on the Berlin defnition. Te MATLAB Simulink was used to simulate the system. Te results show that the fuzzy-based ARDS Berlin defnition can guide the physician on the adjustments to be made during the ventilation.


Acute Respiratory Distress Syndrome (ARDS).
Acute respiratory distress syndrome (ARDS) [1][2][3] is a deadly respiratory failure [4] that is determined using arterial blood gas levels (hypoxemia with a ration of PaO 2 to FiO 2 being less than or equal to 300 mm•Hg) and chest imaging of bilateral opacities.Bilateral opacity is a type of pulmonary opacity (increased pulmonary attenuation where the amount of air in the lung airspaces decreases due to the airspaces being flled with fuid that is leaked into the alveoli due to the lung damage).Terefore, since the fuid is leaked into the alveoli causing pulmonary edema, there is also an oxygen defciency in the arterials.Furthermore, the fuids in excess also increase the mortality rate of patients with ARDS [5]; there is a need of detecting it early enough to reduce the mortality rate.
Te etiology of ARDS is a direct lung injury but due to mainly two causes, namely, pulmonary ARDS and extra-pulmonary ARDS.For the case of the pulmonary ARDS, the lungs are damaged by factors within the lungs such as lung contusion (bruise on the lung due to chest blow), smoke inhalation, viral pneumonia (when a lung tissue is swollen due to a virus), and fat embolism (when fats from a bone slide into the blood vessels) [6]; and for the case of extrapulmonary ARDS, the lungs are afected by external factors [7] such as head injury, trauma, cardiopulmonary bypass (use of an artifcial ventilator during surgery to help in blood circulation and maintaining the oxygen content in the patient's blood).Te two etiological ways are inconsistent with diferent MV, implying that there is a need for a chest scan to determine the causes of the ARDS such that efective settings are implemented by the operator as well as use the lung injury preventive methods.
Tere is a similarity in the treatment of neonatal ARDS and coronavirus disease 2019 (COVID-19) ARDS [8,9], and there is also a similarity in the treatment of respiratory distress syndrome (not ARDS) and COVID-19; this therefore implies that a system developed can be used to treat diferent cases, that is, neonatal ARDS, COVID-19 related to ARDS, respiratory distress syndrome which is not acute, and COVID-19.Tere has been development in the procedures taken during the treatment of patients with ARDS [10], that is, using the Berlin defnition or Kigali defnition.For this study, the Berlin defnition was taken as the case study in the development of the fuzzifed Berlin defnition system.
1.2.ARDS Berlin Defnition.Berlin defnition consists of mainly four factors, that is, the time at which to confrm ARDS is one (1) week from the time of clinical insult; bilateral opacities detected using the chest imaging; origin of edema, of which the authors argue that the cardiac failure and fuid overload may not well explain the cause of respiratory failure though they are the best in detecting patients with ARDS; the ARDS was also further defned inform of its severity, that is, mild (200 < PaO 2 /FiO 2 ≤ 300), moderate (100 < PaO 2 /FiO 2 ≤ 200), and severe (PaO 2 /FiO 2 ≤ 100) [11].Te severity of ARDS can also be determined by the amount of the extravascular lung water [12]; the more the lung water, the more severe the ARDS case.
Low positive end-expiratory pressure (PEEP) can improve the oxygenation [13]; however, some authors argue that high PEEP improves PaO 2 /FiO 2 compared to the low PEEP [14] for the subgroup of ARDS patients, that is, the severe case of ARDS patients [15,16,19].
1.3.Related Work.Sahetya et al. [17] and Brower et al. [18] indicate the required lower PEEP and higher PEEP parameters with respect to their FiO 2 parameter as shown in Table 1 during the ventilation.It is to be noted that the physicians are to follow this PEEP adjustment such as to efectively ventilate the ARDS patient; however, this comes with human errors; physicians during emergency medicine intervention may erroneously adjust the ventilator settings due to reasons such as being tired or low number of physicians who are overwhelmed by the number of patients needing their attention, and the table has no room for fexibility in adjustments, that is, there are few numbers indicated, for example, for a patient receiving lower PEEP has no numbers such as 6, 7, and 9, among others in PEEP adjustment, leaving a gap for the physicians to guess where they are not sure.Nguyen et al. [19,20] apply the fuzzy rule-based models and use three input parameters, namely, PEEP, peak airway pressure (PAP), and arterial oxygen saturation (SaO 2 ).Te fuzzy system, however, has the challenge that it is not per the ARDS Berlin defnition of adjusting PEEP based on the FiO 2 values alone.
In this research, a fuzzy-based approach is used in training the algorithm to understand the parameters that would have been adjusted by the physicians during the ventilation of a patient with ARDS.Te fuzzy system consists of crisp input, fuzzifcation, membership functions, rule base, fuzzy inference system, defuzzifcation, and crisp output.Tese are the steps/procedures followed during the design of a fuzzy rule-based system using a fuzzy logic designer and/or neuro-fuzzy designer application installed in MATLAB software.Te fuzzy-based Berlin defnition system will reduce the physician errors, extrapolate or attain the missing data in PEEP table as shown in Table 1, as well as address the challenges that come with misinterpretation of the ventilator parameters during the ventilation [21].

Fuzzy Rule Based
Model.Te fuzzy rule-based system will be used to suggest the medical ventilator parameter adjustments for the physicians by using the Mamdani fuzzy ruled-based model.Te functional components of the fuzzy system are explained below.

Crisp Input.
Te PEEP and FiO 2 parameters were used as the inputs for training the algorithm.Crisp inputs in the fuzzy system represent the raw inputs from the patient.

Fuzzifcation.
Te crisp input values are then converted into fuzzy values through membership functions (triangular and trapezoidal membership functions were used in this research), which convert the raw crisp inputs into the degree of truth, that is, between zero (0) and one (1) and including zero (0) and one (1).

Expert Fuzzy System/Rule
Base.Te fuzzy values then are interpreted using the expert fuzzy system.Te expert fuzzy system contains a set of rules or knowledge that maps the fuzzy inputs to the fuzzy outputs.In this research, the rules are constructed from the existing PEEP table as shown in Table 1.Te ARDS PEEP adjustment requires that there is an increment of PEEP until the set PEEP matches the FiO 2 value.Terefore, for a particular FiO 2 value having a physician set PEEP less than the desired ARDS PEEP, the change in PEEP (output) was set to "Increase," and for a physician 2.1.6.Crisp Output.Te crisp output value is a signal that will be used in guiding the physician(s) in adjustment of the medical ventilator parameters.

Linguistic Terms Used.
Te "Linguistic meaning/params" column is the membership function parameters of the "Linguistic term" column.
Table 2 shows the parameters of the FiO 2 linguistic terms ranging from F1 to F9. Te membership function that was used in this research was the triangular type for F1 to F9, ranging from zero (0) to one (1) since the Berlin defnition of ARDS considers a 0-1 scale for FiO 2 .
Table 3 shows the parameters of the high PEEP linguistic terms ranging from HP1 to HP8.Te membership functions that were used in this research were the trapezoidal type for HP1 and triangular type for HP2 to HP8, ranging from zero (0) to twenty-four (24) since the Berlin defnition of ARDS considers a 0-24 scale for PEEP adjustments.
Table 4 shows the parameters of the low PEEP linguistic terms ranging from HP1 to HP9.Te membership functions that were used in this research were the trapezoidal type for HP1 and triangular type for HP2 to HP9, ranging from zero (0) to twenty-four (24) since the Berlin defnition of ARDS considers a 0-24 scale for PEEP adjustments.
Table 5 shows the parameters of the pH linguistic terms consisting of low, moderate, and high.Te membership functions that were used in this research were the trapezoidal type for low and high and triangular type for moderate, ranging from zero (0) to fourteen (14) since the Berlin defnition of ARDS considers a 0-14 scale for pH adjustments.

FiO 2 and PEEP Fuzzy Rules.
Te fuzzy set rules for low PEEP are shown in Table 6 with the continuation of the fuzzy set rules in Table 6, and for high PEEP, the rules are shown in Table 7.

General System.
Te design of the system is to guide the physician in determining how much of the adjustments to make during the ventilation after taking measurements from the patient.Te system is based on the ARDS Berlin defnition of the procedure taken during the ventilation of an ARDS patient.
Figure1 shows a patient whose readings/crisp inputs (inputs to the fuzzy system) are taken, that is, FiO 2 , PEEP, and pH.Te crisp inputs are fuzzifed as shown in Figures 2  and 3. Te "FiO 2 and PEEP input subsystem" is a subsystem that generates simulated FiO 2 and PEEP data to be fed into "FiO 2 and PEEP subsystem"; the readings are then taken using the Simulink display and simultaneously plotted using the Simulink scope.4 is used as a loop path for the "FiO 2 and PEEP subsystem" and "pH fuzzy subsystem."Te input 1 (In 1) connected to the output 1 (Out 1) is the FiO 2 and PEEP data from the  Advances in Fuzzy Systems patient to the" "FiO 2 and PEEP input subsystem" fuzzy system.Te input 2 (In 2) connected to the output 2 (Out 2) is the pH data from the patient to the "pH fuzzy subsystem" fuzzy system.Te output 1 (Out 1) in Figure 4 connects to the input 1 (In 1) in 3; output 3 (Out 2) in Figure 5 connects to the input 1 (In 1) in Figure 4.

Patient Subsystem. Te patient subsystem in Figure
Te output 2 (Out 2) in Figure 4 connects to the input 1 (In 1) in Figure 3; output 2 (Out 2) in Figure 3 connects to the input 2 (In 2) in Figure 4.

FiO 2 and PEEP Input Subsystem.
Te input 1 (In 1) is the FiO 2 data passed through the initial condition block (Initial FiO 2 ) to initialise the signal during the simulation.Te signal is set through the code block (initial input code block) whose purpose is to pause the loop after one second; input u0 is connected to the output, y0.
Te if-condition (if-condition 3) triggers the signal from the code block output y0; if the output y1 from the code block is equal to zero (0), then the signal is sent from output y0 to memory 2, which is then added on a bias (Bias 3) of 0.1.Te ifcondition (if-condition 4) helps in triggering the PEEP.Te initial PEEP is set to zero (0) and then sent to input; u1 of the code block which is connected to output y1.Te signal from the output y1 is added on a bias (Bias 1) of 1, and then the signal is sent to memory 1. Te signal is then fed into the code block (loop code block) that contains an if-condition; if input u1 is less than 25, then output y0 is connected to input u1; otherwise, the output y0 is connected to input u0.Te simulation stops if the FiO 2 input is greater than 0.9.
Te action subsystems ("If Action Subsystem 1.1," "If Action Subsystem 1.2," "If Action Subsystem 3," and "If Action Subsystem 4") are used to relay the original signal Te output 1 (In 3) in Figure 5 connects to the input 1 (In 1) in Figure 2; output 2 (In 2) in Figure 5 connects to the input 2 (In 2) in Figure 2.

FiO 2 and PEEP Fuzzy Subsystem. Te inputs (In 1 and
In 2) are fed into the Fuzzy Logic Controller (FLC) as crisp inputs and then output as crisp output which is the change in the PEEP to be made.Te output (change in PEEP) is then added to the initial PEEP.Te output 1 (Out 1) in Figure 2 is then displayed and plotted using the Simulink display and scope, respectively.
Te if-condition (If-condition 1) is used to generate the PEEP data for as long as the PEEP is less than or equal to 24. 8 shows the linguistic terms used for pH, respiratory rate, and change in tidal volume.Te pH was used as the input variable to guide in adjusting the output variables, namely, respiratory rate and change in tidal volume.

pH Fuzzy Subsystem. Table
From Figure 3, the initial input of the pH is started with zero (0) in the simulation and then fed into the Fuzzy Logic Controller1 (FLC1) as crisp input; the crisp outputs are the changes in the respiratory rates and tidal volumes.Tere is a bias (Bias 1) of 0.1 that is added to memory 1 to make a loop so as to generate data for simulation.Te simulation is stopped if pH is greater than 14.Te output 1 (Out 1) is then connected to the Simulink display and scope.
Te membership functions used in designing the FLC are shown in Figures 6-12.

Results and Discussion
Te results were attained from the Fuzzy Logic Designer rule viewer and Fuzzy Logic Designer surface, and the Neuro-Fuzzy Designer was used to imitate the exact output expected from the acute respiratory distress syndrome network (ARDSNet) protocol for positive end expiratory pressure (PEEP) during the ventilation of ARDS patients; the Advances in Fuzzy Systems algorithms were then used in the simulation using the graphical and interactive Simulink tool in MATLAB software.Tables 9 and 10 show the comparison between the physician-based Berlin defnition of ARDS using the ARDSNet protocol [17,19] and the fuzzy based Berlin defnition of ARDS.Te ARDSNet protocol requires that there is a PEEP adjustment of 2 to 4 during the ventilation which is why the adjustments in Tables 9 and 10 do not exceed 4 in value adjustment.
It is noticed that the physician-based Berlin defnition of ARDS has whole numbers compared to fuzzifed system of Berlin defnition of ARDS.Tis implies that the fuzzybased Berlin defnition of the ARDS system is more   Advances in Fuzzy Systems accurate since it considers how fast the system makes the decision and its application of the possibility theory in adjustments of the PEEP.

Simulink Graphs
3.1.1.FiO 2 Input and Initial PEEP Input Graph.Sahetya et al. [17] and Brower et al. [19] indicate the recommended range for PEEP values as 0-24 and the values of FiO 2 range of 0-1.So, Figure 13 shows the graph indicating the recommended ranges of the input data (PEEP and FiO 2 ) on the y-axis against time on the x-axis.Te plot in blue colour shows the initial PEEP input range readings from 0 to 24, and the plot in yellow colour (which is close to the x-axis) represents the FiO 2 recommended range input readings from 0 to 1. Ten, Figure 14 shows the high PEEP ARDSNet protocol used in treating patients with ARDS (the graph was generated using the fuzzy neural network to mimic the exact values indicated by the authors [17,19]); the red coloured PEEP (ARDSNet protocol recommended high PEEP adjustments) plots depend on the yellow coloured FiO 2 inputs; as the FiO 2 inputs change, so do the PEEP values (labelled as "Berlin High PEEP" on the graph).Te blue plots are still shown in Figure 14 to represent the whole range of the recommended high PEEP values.

FiO 2 Input, Initial
High PEEP Input, and Adjusted PEEP Output Graph. Figure 15 shows the simulated results after employing the fuzzy logic reasoning of the high PEEP algorithm.As explained previously, the plots in yellow colour are the FiO 2 inputs, initial PEEP inputs are in blue colour, and the fuzzifed outputs (labelled as "adjusted PEEP output" on the graph) are in the red colour.Te graph shows how the FiO 2 input when adjusted afects the fuzzifed outputs.For example, when the FiO 2 value changed from 0 (zero) to 0.1, no change was indicated in the fuzzifed output since the recommended PEEP is not indicated in Table 1.When the FiO 2 input changed to 0.3, the fuzzifed output changed on the graph to match the recommended PEEP value of up-to 14 as shown in Table 1.Te graph shows that it covers up the data missing in Table 1; when FiO 2 input  Advances in Fuzzy Systems changed to 0.4, the fuzzifed output changed as well up-to PEEP 16; the fuzzifed PEEP values keep on changing based on the FiO 2 inputs as guided by Table 1.Advances in Fuzzy Systems generated using the fuzzy neural network to mimic the exact values indicated by the authors [17,19]); the red coloured PEEP (ARDSNet protocol recommended low PEEP adjustments) plots depend on the yellow coloured FiO 2 inputs; as the FiO 2 inputs change, so do the PEEP values (labelled as "Berlin low PEEP" on the graph).Te blue plots are still shown in Figure 16 to represent the whole range of the recommended low PEEP values.Advances in Fuzzy Systems Figure 17 shows the simulated results after employing the fuzzy logic reasoning of the low PEEP algorithm.Te plots in yellow colour are the FiO 2 inputs, the plots in blue colour are the initial PEEP inputs, and the outputs (adjusted PEEP output) are in the red colour.Te graphs indicate the same procedure as for Figure 15, with the only diference that the algorithm was trained using the low PEEP values.

pH Input, Respiratory Rate Adjustment, and Tidal
Volume Adjustment Graph. Figure 18 shows the simulated results of the pH algorithm after employing fuzzy logic reasoning.Te plots in yellow colour are the pH inputs, the plots in blue colour are the fuzzifed respiratory rate outputs, and the fuzzifed tidal volume adjustment outputs are in the red colour.Te graph shows how, according to the ARDS Berlin defnition, the input pH parameter should afect the adjustments of the respiratory rate and tidal volume.

Conclusion
Te MATLAB Simulink was used to simulate the system.Te results show that the fuzzy-based ARDS Berlin defnition can guide the physician on the adjustments to be made during the ventilation with more accuracy.Tis, therefore, will reduce the death related errors made by the physicians due to human errors and will increase the speed of decision-making during ventilation.Advances in Fuzzy Systems

3. 1 . 3 .
FiO 2 Input, Initial Low PEEP Input, and Adjusted PEEP Output Graph.Figure16shows the low PEEP ARDSNet protocol used in treating patients with ARDS (the graph was

Figure 6 :
Figure 6: Membership function for change in PEEP output.

Figure 7 :Figure 8 :
Figure 7: Membership function for change in respiratory rate output.

Figure 12 :
Figure 12: Membership function for pH input.

Figure 14 :
Figure 14: Graph showing the relationship between the two input parameters: FiO 2 (yellow in colour) and general range of PEEP (blue in colour), with the fuzzifed Berlin high PEEP output (red in colour).

Figure 16 :
Figure 16: Graph showing the relationship between the two input parameters: FiO 2 (yellow in colour) and general range of PEEP (blue in colour), with the fuzzifed Berlin low PEEP output (red in colour).

Figure 18 :
Figure 18: pH input, fuzzifed change in respiratory rate adjustment, and fuzzifed change in tidal volume adjustment graph.

Table 3 :
High PEEP linguistic terms used.

Table 4 :
Low PEEP linguistic terms used.

Table 5 :
pH linguistic terms used.

Table 6 :
FiO 2 and low PEEP fuzzy set rules.

Table 7 :
FiO 2 and high PEEP fuzzy set rules.

Table 8 :
pH, respiratory rate, and tidal volume fuzzy set rules.

Table 9 :
Comparison between physician-based Berlin high PEEP defnition and fuzzifed Berlin high PEEP defnition.

Table 10 :
Comparison between physician-based Berlin low PEEP defnition and fuzzifed Berlin low PEEP defnition.