Introduction

Fluids, medicines, and nutrients are often administered to patients using a peripheral Intravenous (IV) catheter as part of intravenous IV therapy, which is an essential part of patient care. IV therapy is widely used in emergency care, surgical procedures, and treatment of critical illness for patients who cannot take oral medications [1].

Despite its importance, complications such as infiltration, phlebitis, and infection can occur. It is absolutely necessary and vital to carefully regulate the infusion rate to prevent adverse reactions and ensure patient safety [2]. Traditional control of IV drips may not be accurate enough to address the requirements and conditions of a patient. Recent studies have explored the use of fuzzy logic (FL)-based control systems to improve the accuracy and safety of IV therapy [3, 4]. FL is a mathematical tool that can model uncertain and imprecise information by allowing degrees of truth between true and false. FL-based IV controllers can adjust the infusion rate in response to changes in patient conditions and other factors, such as changes in the position of a patient's health or in the process catheter, resulting in improved precision and safety [5].

This paper aims to suggest an FL that is able to control the amount of saline given to a patient and control the amount of bubbles in order to preserve the patient’s life. As a contribution, an intelligent saline controlling valve (ISCV) is proposed in this study.

The remaining sections after the “Introduction” section of the introduction are distributed as follows: the “Related work” section reports related works, the “Methodology” section illustrates methodology, the “Results and discussions” section reveals results, and the “Comparisons” section provides the conclusion.

Related work

Numerous studies have looked into using FL to select and administrate IV solutions for critically ill people.

Anand et al. used technologies including drip irrigation according to mobile networks by using the fuzzy technique. The text initially expounded upon the drip irrigation system and its management through the utilization of mobile network technology. The mobile network enabled remote system monitoring and user control. As a result, the fuzzy controller algorithm analyzed the incoming data in real-time and computed the necessary quantity of water needed. It is noteworthy that implementing such systems could result in significant water conservation with relative ease. The simplicity of the system architecture rendered it advantageous for agricultural practitioners [6].

Wu et al. developed a piggyback intravenous drip frame balance control system. The system had main qualities: the device moved with the body, the system worked with shoulder and neck movements, and the control mechanism might automatically restore the frame tilting angle. The proposed system was compared to the Proportional-Integral-Derivative (PID) controller, Ziegler–Nichols method, and Tyreus–Luyben method. In weight and angle conditions, the fuzzy PID method outperformed others in settling time, percentage undershoot, and steady-state error. This work improved patient mobility and quality of life [7].

Strušnik and Avsec established a method to detect more reasonable manufacturing options for one of the energy-generating products. It might be power-generation products. Efficiency without investment made it more logical. Peak heaters should only be used for citywide heating systems in extreme instances. By rationalizing peak heater consumption and using the extracted base heater, 3 steam mass flow was lowered and 5 was removed. Steam used for heating exits intermediate turbines at extractor 5, not extractor 3 as with the existing arrangement. This entropy study suggested that running the turbine with lower extract pressure 5 was appropriate. Low-pressure control valves (LPCV) and citywide heater core heating systems had higher specific power losses [8].

Al-Ridha et al. developed an independent software vendor (ISV) system utilizing the Automated Fingerprint Identification System (AFIS). Upon establishing the ground-truth, the proposed approach was implemented. Initially, a FL system was developed with a reliance on two distinct inputs, namely pressure and temperature, and a singular output, which was the percentage of valve opening. The system was successfully deployed and all the necessary data were gathered. Subsequently, the gathered data were separated into two distinct categories, namely the training group and the testing group. The ISV approach was developed, trained, and evaluated. The process of testing resulted in a discrepancy error of 0.42 between the factual output values and the anticipated output values [9].

Sruthy et al. used a fuzzy logic strategy to determine indicators of water quality and nutritional status, which could determine the quality of a water body as a result of different environmental parameters. It was observed that eutrophication was one of the major threats to surface water bodies. In this work, the nutritional status of Ashtamudi lake was studied. The response of some primary and secondary variables and indicators during the pre-monsoon season was analyzed. The proposed approach was worked on using the data of the years 2013–2015, which were regularly monitored by the Kerala Pollution Control Board. The predicted nutritional status by the approach was found to be concordant. However, it was estimated using the Carlson method. Thus, the model based on secondary indicator criteria could be used to assess the nutritional status of lakes and help policy makers formulate regulations to reduce eutrophication [10].

Kumar and Viswanadh proved that the results of polluted groundwater were in areas close to the sea coast and the degree of salinity in groundwater gradually decreased with increasing distance from the sea coast. Through the study, it was found that the weighted fuzziness values for the wells near the sea showed higher values compared to the weighted fuzzy values for most of the wells far from the coast. As a result, it was found that the main cause of pollution was seawater. By applying fuzzy logic, it seemed to be more effective and accurate to study the degree of groundwater pollution due to seawater intrusion into the coastal aquifers. The area in which the population depended mainly on groundwater for their daily use was studied, as the study indicated, however, that groundwater was not suitable for human use [11]. There are other studies that used artificial intelligence methods and they can be useful in this work after adaptations such as [12,13,14,15,16,17].

Overall, these studies indicated that FL-based decision support systems can be useful in the selection and administration of intravenous solutions for personalized fluid management. However, additional investigation is required to assess the efficacy of these systems in a clinical setting.

Methodology

FL background

FL was initially proposed by Zadeh during the mid-twentieth century. The subject matter pertains to the uncertain nature of language in the context of fuzzy analysis. This subject comprises efficacious components. Examples of such components are membership functions and rules which have been discussed in [18]. The FL has been utilized in diverse domains including engineering, medicine, industrial, computer science, and others [19, 20].

Fuzzy logic explores the fascinating realm of a fuzzy set, a set that lacks a rigid well-defined boundary. Within this set, there are elements that possess only a partial degree of grouping membership. A crucial requirement for a membership function is its ability to fluctuate within the range (0,1) [21].

Let \(X\) represent the universe of discussion and its elements are indicated by \(x\), then a fuzzy set \(A\) in \(X\) is described as a collection of elements:

$$A = \{x, {\mu }_{A}(x) | x\in X\}$$
(1)

where \({\mu }_{A}(x)\) represents the \(A\) membership function of \(x\) [22].

The membership function maps each element of \(x\) to a value of membership that ranges [0, 1]. Hence, to resolve the statements A and B, where A and B are limited to the range [0,1], we can utilize the AND expression to represent the minimum function: min(A,B). By employing the same line of reasoning, we can substitute the OR expression with the maximum function: max(A,B). So, the NOT A expression can be deemed equivalent to the operation 1-A [23].

The intersection of two fuzzy sets \(A\) and \(B\) can be defined and described by a binary mapping \(T\), which combines and consolidates the membership functions of these sets. This binary mapping \(T\) individually takes into account the membership functions of \(A\) and \(B\), and produces a new membership function for the intersection of \(A\) and \(B\). This process of aggregating the membership functions can be mathematically represented as

$${\mu }_{A\cap B}(x) = T({\mu }_{A}(x), {\mu }_{B}(x))$$
(2)

The result of this mapping operation provides a comprehensive understanding of the overlapping region between \(A\) and \(B\).

Similar to the fuzzy intersection, the fuzzy union operator is also characterized by a binary mapping \(S\). This binary mapping takes into consideration the membership functions of \(A\) and \(B\) and combines them to generate a new membership function. This mapping operation can be represented as:

$${\mu }_{A\cup B}(x) = S({\mu }_{A}(x), {\mu }_{B}(x))$$
(3)

This equation allows us to comprehend the overall extent of the combined sets \(A\) and \(B\) [22].

There are multiple existing strategies that are utilized for converting a fuzzy control command into a precise command in the fuzzy control such as the maximum strategy, the mean of maximum (MOM) strategy, and the centroid strategy. The maximum strategy involves searching and selecting for the value with the utmost membership, it emulates the conventional practice of selecting the most applicable rule in rule-based systems. A commonly used extension known as the MOM, it identifies all points that possess the membership and computes their average. The centroid strategy calculates a weighted average of the fuzzy command regarding membership degrees as weights associated with each precise command. The formula for computing the weighted average for a discrete-valued fuzzy control command can be expressed as:

$$z=\frac{{\sum }_{k=1}^{n}m\left({w}_{m}\right).{w}_{m}}{{\sum }_{k=1}^{n}m\left({w}_{m}\right)}$$
(4)

where \(z\) is the calculated value, \({w}_{m}\) is the value of each crisp command, \(k=\text{1,2},\dots ,n\) and \(m\left({w}_{m}\right)\) is the membership value of the fuzzy control command at \({w}_{m}\) [24].

The defuzzification process involves the transformation of a fuzzy set, specifically the aggregate output fuzzy set, into a crisp or single numerical value. This process is essential to convert the fuzzy set into a format that can easily be interpreted and utilized for further analysis or decision-making. By employing appropriate defuzzification methods, a clear and unambiguous output can be obtained, represented as a single number. This numeric output serves as a concise representation of the information contained within the aggregate output fuzzy set [25].

In summary, the intersection and union of fuzzy sets can be defined and understood through the utilization of binary mappings \(T\) and \(S\), respectively. These mappings allow to capture of the overlapping and combined regions of the fuzzy sets. Furthermore, the defuzzification process provides a crisp numerical output, enabling efficient analysis and decision-making based on the aggregate output fuzzy set.

Suggested FL approach

The purpose of this study is to design and suggest a FL-based control system for an IV drip system. A valve regulates the flow rate of the IV solution and an FL can control the given amount of solution on a regular basis as demonstrated in Figs. 1 and 2.

Fig. 1
figure 1

Main process of giving Saline to a patient

Fig. 2
figure 2

Suggested controlled project of giving saline to a patient

Figure 1 shows normal saline given to the patient via his/her vein. The speed of flow can be controlled by using the valve (flow controller). From the drip chamber, proper flow can be achieved by considering the speed of drip and \(L\), which represents the distance from the primary solution to the needle inside the patient’s vein. It is important to highlight that two conditions must be met. Firstly, \(L\) should not be less than 1 meter. Secondly, the flow unit should be above the patient.

Small air bubbles in the bloodstream can usually be eliminated by the body. Large air bubbles or many tiny bubbles can induce air embolisms. Healthcare providers are taught to carefully prepare and administer intravenous fluids, including eliminating air bubbles from the syringe and tubing before infusion. Many infusion pumps and intravenous administration sets have air detectors or alarms to notify the provider of air in the queue. Air bubbles or odd symptoms following intravenous fluids should be reported to a doctor promptly. In other words, when intravenous normal saline to a patient, some air bubbles may be inserted in the tube and syringe. Air bubbles can negatively affect the saline injection process. Therefore, the idea of proposing the ISCV approach was proposed to sort out this problem. Figure 2 displays the location of the suggested ISCV approach and how it can be useful as an FL system for controlling the amount of saline given to a patient. Figure 3 shows the main block diagram of our ISCV approach.

Fig. 3
figure 3

Main block diagram of our ISCV approach

The ISCV is a Mamdani FL type. It has three input variables namely: drip, pressure, and bubble. It produces two important output variables called: valve open and force stop.

The ISCV approach can be illustrated as having a process model that is able to introduce its controller in a loop for regulating the inputs’ parameters to be controlled. Figure 4 shows the demonstrated block diagram for this.

Fig. 4
figure 4

The ISCV approach with a process model that is able to introduce its controller in a loop for regulating the inputs' parameters to be controlled

From this figure, it can be understood that the three ISCV inputs of the drip, pressure, and bubble are controlled by a tunning process where the values of each one of them are changed and the outputs are obtained at the same time.

Results and discussions

We have evaluated the performance of the ISCV taking into account its ability to maintain a constant flow rate of saline solution controller represented as the inputs of drip, pressure, and bubble that may occur during the administration process [26]. We have also considered the flow rate of the saline solution and have introduced disturbances in the system to assess the controllers' robustness.

So, inputs and outputs both have membership functions, including three membership functions for the inputs of drip, pressure, and bubble, and two membership functions for the outputs of valve open and force stop. Figures 5, 6, 7, 8, and 9 display all the utilized membership functions in this work.

Fig. 5
figure 5

Membership functions for the drip input

Fig. 6
figure 6

Membership functions for the pressure input

Fig. 7
figure 7

Membership functions for the bubble input

Fig. 8
figure 8

Membership functions for the valve open output

Fig. 9
figure 9

Membership functions for the force stop output

It is worth mentioning that the ISCV fuzzy rules are considerably designed to provide efficient outputs. The designed fuzzy rules are considered as follows:

  1. 1-

    If (bubble is few) then (force stop is low).

  2. 2-

    If (bubble is many) then (force stop is high).

  3. 3-

    If (drip is fast) and (pressure is very large) then (valve open is strong close).

  4. 4-

    If (drip is fast) and (pressure is large) then (valve open is close).

  5. 5-

    If (drip is fast) and (pressure is medium) then (valve open is medium).

  6. 6-

    If (drip is fast) and (pressure is low) then (valve open is open).

  7. 7-

    If (drip is fast) and (pressure is very low) then (valve open is strong open).

  8. 8-

    If (drip is slow) and (pressure is very low) then (valve open is strong open).

  9. 9-

    If (drip is slow) and (pressure is low) then (valve open is open).

  10. 10-

    If (drip is slow) and (pressure is medium) then (valve open is medium).

  11. 11-

    If (drip is slow) and (pressure is large) then (valve open is close).

  12. 12-

    If (drip is slow) and (pressure is very large) then (valve open is strong close).

  13. 13-

    If (drip is middle) and (pressure is very large) then (valve open is close).

  14. 14-

    If (drip is middle) and (pressure is large) then (valve open is close).

  15. 15-

    If (drip is middle) and (pressure is medium) then (valve open is medium).

  16. 16-

    If (drip is middle) and (pressure is low) then (valve open is open).

  17. 17-

    If (drip is middle) and (pressure is very low) then (valve open is open).

The set of fuzzy rules that are presented form the basis of a control system intended to regulate the relationship between drip speed, pressure, and bubble quantity in order to provide the proper stopping force and degree of valve openness. These rules can be briefly discussed as follows:

  1. 1-

    Impact of bubbles on force stops: there is a clear correlation between the number of bubbles and the force needed to stop, as shown by rules 1 and 2. While many bubbles signify the requirement for a higher force, few bubbles suggest a lower force. This is an instinctive reaction to the fizzy environment’s fluctuating intensity.

  2. 2-

    Effects of pressure and drip speed on valve openness: the relationship between the ideal valve openness, pressure levels, and drip speed is outlined in Rules 3 through 17.

The system uses pressure to determine how quickly to close the valve: very high and high pressures cause the valve to close strongly, medium pressure indicates a medium closure and low pressure causes the valve to open more. Strong valve openness occurs when there is extremely low pressure combined with a rapid leak. Similar steps are taken when releasing pressure; the degree of valve openness is changed accordingly.

Moderate-range drip situations: particularly, moderate drip speed circumstances are covered by rules 13 through 17. In this case, the system adjusts the valve openness based on different pressure levels. In situations where the drip pace is neither exceptionally fast nor slow, this enables a nuanced reaction.

In conclusion, these fuzzy rules produce a dynamic control system that adjusts force for stopping and valve openness in response to changing pressure levels, drip speeds, and bubble quantities. The system’s performance can be optimized under various operating conditions by following the rules, which encompass a flexible and responsive decision-making process.

We have tested the FL control of the ISCV with Mamdani and MOM strategy. Such interesting results have been achieved as can be noticed in Tables 1 and 2, and Figs. 10 and 11.

Table 1 ISCV samples performance for the first output (valve open) when no bubbles have existed (bubble input is always 0)
Table 2 ISCV samples performance for the second output (force stop) when bubbles have existed
Fig. 10
figure 10

General response result of the output values in Table 1 for the first output (valve open) when no bubbles have existed (bubble input is always 0)

Fig. 11
figure 11

General response result of the output values in Table 2 for the second output (force stop) when bubbles have existed

Comparing the outcomes of the two outputs, it can be seen that Table 1 and Fig. 10 demonstrate the performance of the first ISCV output (valve open) when no bubbles existed, whereas, Table 2 and Fig. 11 demonstrate the performance of the second ISCV output (force stop) when bubbles are existed. Table 1 shows how the valve open output is closed according to the drip and pressure inputs. That is, it is regularly closed when the drip is increased, as well as, it is gradually closed when the pressure is raised. So, when there are no passing bubbles, there is no big danger to the patient by having saline. However, the valve is open or closed accordingly to control saline flow. In the absence of bubbles, the process is stable. Table 2 shows how the force stop output is influenced by the drip, pressure, and bubble inputs. Actually, it is especially affected by the bubble input. That is, when there is no bubble, the force stop output does not force saline to stop dripping. Nevertheless, it is regularly influenced by the Bubble input until this input reaches its highest value, which means that the bubbles are too much and can cause big danger to the patient. In this case, the force stop output is fully affected and it forcibly stops saline flow. So, the greater the percentage of bubbles, the highly activated the force stop and vice versa.

Comparisons

A comparison between a conventional proportional–integral–derivative (PID) controller and our approached FL controller is considered. Firstly, a conventional PID controller has been implemented, see Fig. 12. The output of the valve open is concentrated here as the output of Force Stop effects essentially forcibly stopping the valve from being open (stopping the saline drainage of the valve open).

Fig. 12
figure 12

Conventional PID controller implementation

The conventional PID controller requires working with the three parameters of proportional, integral, and derivative. It is comparably simple. It can deal with linear and non-linear systems, actually, it is appropriate for linear and well-defined systems. It has limited adaptability and flexibility. It is considered as a basic controller. On the other hand, the approached FL controller is designed for intelligently controlling a saline valve. It works as a non-linear system. It uses complicated yet smart processes. It has adaptability and flexibility to produce outputs for provided inputs. The most important point to be raised here is that it is an intelligent controller.

To further improve the work of this paper, the rules of a fuzzy proportional integral (PI) controller and a fuzzy PID controller have been implemented and considered too. Again, the output of valve open is focused here as a previous comparison with the conventional PID controller and for the same reported reason. Figures 13 and 14 demonstrate the relationships between errors and changes in valve open for the fuzzy PI controller and fuzzy PID controller, respectively.

Fig. 13
figure 13

Relationships between the error interval and change in valve open for the fuzzy PI controller

Fig. 14
figure 14

Relationships between the error rate, error, and change in valve open for the fuzzy PID controller

From these figures, it can be noticed that both the fuzzy PI controller and fuzzy PID controller have interested outcomes yielding further improvements on the work of the ISCV approach. That is, the fuzzy PI controller investigates the effects of error on the change in Valve Open and the fuzzy PID controller observes the influences of error and error rate on the change in Valve Open. All errors seem to refer to the acceptability of the ISCV continuous implementation.

Conclusion

The increase in population poses a significant and formidable challenge, necessitating a corresponding increase in medical staff to effectively address the concurrent rise in diseases and infections. The imperative to closely monitor medical cases further underscores the pressing need for a larger number of medical personnel. In light of this, the primary objective of this endeavor is to provide invaluable assistance to doctors, thereby alleviating their burden and reducing the number of doctors required for patient follow-up in the context of treatments and intravenous nutrient administration. This ambitious undertaking seeks to accomplish this by pioneering an innovative approach based on the FL termed the ISCV. The proposed approach encompasses three inputs and two outputs, specifically the inputs of (drip, pressure, and bubble) and the outputs of (valve open and force stop). The force stop is operating as a switch, it is used to protect the patient from associated risks with bubbles. When there are risky bubbles, the force stop is activated and stops the outputs of the valve open. On the other hand, when there are no bubbles, the force stop is deactivated, allowing the valve open to work reasonably. In essence, the overarching ambition of this research is to develop and incorporate the efficiency of control capabilities that consider human safety.