A fuzzy inference system (FIS) is an intelligent system that allows reproducing the ability of the human mind to approximate vague data, extracting from them useful information, and producing crisp output [
29]. Its potential can be applied to numerous domains and particularly to the medical field to model the high complexity and uncertainty that characterizes medical processes [
30,
31]. Starting from the definition of the system knowledge base, built through the help of doctors and clinical experts, an FIS gives the possibility to transfer human and expert knowledge into intelligent and automatic models using linguistic terms [
32]. Fuzzy sets are used to treat uncertainty and to represent knowledge through rules. The fuzzy logic allows the interpretation of data with predefined linguistic variables according to appropriate IF-THEN rules written as:
where the situation represents the antecedent or the premise consisting of fuzzy terms connected by fuzzy operators, while the output is called consequent or conclusion [
33]. Fuzzy logic defines the inferential mechanisms needed for reaching the output value related to the OR’s air quality status starting from its main parameters and constitutes the inferential engine of the FIS.
2.3.2. Fuzzy Inference Engine
All the designed clinical linguistic variables, membership functions, and rules have been included in a Mamdani FIS [
35,
36]. The Mamdani approach has been widely and successfully applied to different areas, such as data classifications, decision analysis, expert systems, and it is often exploited for designing decision support systems thanks to its ability to imitate human thought processes in complex circumstances and to accurately perform repetitive tasks [
37,
38]. In the following, the Mamdani framework and the basic knowledge implemented into the system are described with reference to multi-inputs and single-output decision model, and the following definition holds.
Definition 3. Given m “if antecedent then consequent” fuzzy rules R = {R1; …; Rm}, with n continuous input variables ui, i = 1, …n, and the output variable y, the formulation of the fuzzy rules is defined as follows:where ui are the input variables, y is the output variable, and Aij and Bi are fuzzy sets of the associated universes of discourse. To perform inference, the first step is to “evaluate the antecedent”, which involves fuzzifying the inputs and applying any necessary fuzzy operators to each rule in R as follows.
Definition 4. Given the information input u = {u1, …,un}, the strength level or firing level αi of the rule Ri is calculated in terms of the degrees of membership µAij. If the antecedent clauses (the if part) are connected with AND then: Else if the antecedent clauses are connected with OR then: Note that each fuzzy rule yields a single number that represents the firing strength of that rule [39]. The second step is the so-called “implication,” or, in other words, applying the result of the antecedent to the consequent. Indeed, the strength level is then used to shape the output fuzzy set that represents the consequent part of the rule. In so doing, we have:
Definition 5. The operator of implication for the rule Ri is defined as the shaping of the “consequent” (the output fuzzy set), based on the “antecedent”. The input of the implication process is a single number given by the “antecedent”, and the output is a fuzzy set:where y is the variable that represents the support value of output the membership function µBi(·). Now, in order to unify the outputs of all the rules, we need to aggregate the corresponding output fuzzy set into one single composite set. The inputs of the aggregation process are represented by the clipped fuzzy sets obtained by the implication process. The aggregation method exploited in our application is the max(·) one.
Finally, the defuzzification process has been performed starting from the output fuzzy set resulting from the aggregation process according to the following definition.
Definition 6. The operations of defuzzification are computed as the centre of gravity (COG) of the strength levels: 2.3.4. Identification of the Fuzzy Sets
Before their design, there is the need for a preliminary phase for the correct definition of the ranges into which the input variables values must be divided and the choice of the fuzzy sets to be used. The preliminary design phase aims to characterize the inputs and determine the degree to which each of them belongs to a particular fuzzy set through the membership function’s definition. The parameters related to the OR hat will be taken into consideration will be: particle count (PC), temperature (T), and relative humidity (RH). The other two parameters considered are: correctness of healthcare workers’ path (HWP) and time spent by the patient in the prefilter area (TPA). The fuzzification process for each of the listed inputs will be presented below. Finally, the Google Colaboratory platform has been used to perform the fuzzy inference process. Colab uses Python as a programming language and includes most of the standard libraries usually used, including the one dedicated to fuzzy logic.
For the particle count values, 4 fuzzy sets have been considered, as follows: Normal0, High1, High2, and High3; the membership functions of the 4 fuzzy sets were considered to have a trapezoidal shape. To fuzz the particle count (PC), it is first necessary to identify which values are commonly and unquestionably considered normal for ISO 7 5 operating rooms: this range coincides with values below 3.52000 particles/m
3 for particles with a diameter equal to or greater than 0.5 µm (Anon., 2016). Consequently, a fuzzy set called Normal0 was created with CP values lower than 3.540 particles/m
3 with a membership function set to 1 in correspondence with values lower than 3.520 particles/m
3. In fact, to say that the MF is equal to 1 means to affirm that there is a certain belonging of those values to the fuzzy set Normal0. To create a trapezoidal membership function, however, it is necessary to “blur” the set considered by identifying those values outside the range that can be considered normal to a certain degree, as they could also be an alarm indication. For this reason, a decreasing ramp was considered between the values of 3.520 and 3.540 whose purpose is to gradually smooth the degree of belonging to these values to the Normal0 set with degrees of belonging ranging from 0 to 1. Proceeding in the same way, values above 3.520 particles/m
3 were identified as high and they were considered as belonging to the fuzzy set called High1 with MF set to 1, identifying the range between 3.520 and 3.600 particles/m
3 as a transition. Similarly, we proceeded to fuzzify the CP considered even higher up to the fuzzy set High3 for values higher than 3.680 particles/m
3.
Table 4 shows the CP ranges considered with the respective fuzzy sets. The membership functions are instead shown in
Figure 3.
For this input parameter, 3 fuzzy sets have been considered: Low2, Normal0 and High2. The membership functions of the 3 fuzzy sets will be trapezoidal.
Following the same procedure for the definition of the ranges for the particle count, it is possible to create a similar table (
Table 5) in which the temperature values (T) for each fuzzy set can be displayed.
Figure 4 represents the overall membership function.
This parameter, expressed in percentage terms, indicates the relative humidity value of the air. A measurement of this parameter in the standard usually ranges between 40% and 60%. In light of this, 3 linguistic variables have been identified: Low2, Normal0, and High2. All values between 30% and 70% are given the Normal0 label with a trapezoidal membership function.
Table 6 defines the ranges corresponding to each fuzzy set;
Figure 5 shows the corresponding trapezoidal membership functions.
For this parameter, 4 fuzzy sets (Normal0, High1, High2, and High3) have been identified, defined in
Table 7. In detail, since these values are an output of an algorithm capable of evaluating the correctness of the path taken by healthcare professionals (HWP), triangular membership functions were considered.
Figure 6 shows the corresponding membership functions.
Specifically, a special algorithm was implemented to study the data derived from the detection of the HW equipped with a beacon when they enter into a specific area of the operating block. The dataset is therefore composed of the date and time of detection, user id, area in which the EchoBeacon—that detected the signal—is located, and the RSSI. The algorithm read all the information and was saved on an Excel sheet. Before the realization, starting from the planimetry of the operating block, the possible paths, characterized by minimal movements from one area to another (starting point—final point), were studied. For each path, it is possible to define a level of error.
Table 8 shows the paths analyzed with the evaluation expressed according to the fuzzy set.
All paths not shown in
Table 8 are considered adequate ‘Normal0’. The analysis was conducted using Python, a high-level interpreted programming language. The openpyxl is a Python library that reads Excel sheets. In order to evaluate the correctness of the path, since the areas in which a specific HW is located, a matrix has been built that shows the starting points on the rows and the arrival points on the columns (see Equation (7)). Each path is associated with a score that is the peak of the reference triangular membership functions.
By reporting the name of the areas in numerical form, it is possible for each user to access the matrix and assign the score to the path. The output produced is also a matrix showing the user id and the score associated with each point-to-point path for each row. Below is the section of code assigned to the calculation (
Figure 7). A path where the temporal distance between the current area and the next is less than 10 min is considered continuous. Below (Algorithm 1) the code section written in pseudo-language used for the association of the score to the user path is reported.
In this study, the waiting time of the patient in the prefilter area (TPA) is an extremely important parameter. In fact, it is important that the patient transported from relative departments does not stay longer than the necessary time in the non-sterile area, an area in which a patient who has to undergo surgery could run into high risks of infection. Normal waiting time values are less than 10 min. If the wait settles for times exceeding the limit, the level of risk increases.
For this parameter, therefore, 4 fuzzy sets have been considered: Normal0, High1, High2, and High3. In detail, it is possible to consult
Table 9 to observe the ranges considered. In
Figure 7, the trapezoidal membership functions related to the various fuzzy sets can be observed.
The output of the inference engine consists of the “Risk Group” variable (RG). This variable was found to be the most suitable for the case in question since it represents the level of risk associated with the risk of infection for the patient. In fact, this variable can assume 14 different values, on a scale from 0 to 13, where 0 is the level associated with a zero-risk level, while 13 is a very serious risk level; levels 1 to 12 represent an intermediate state of severity. Overall, therefore, there will be 14 fuzzy sets, signed with the L (low) in the case of a low-risk level, with the H (high) in the case of a high-risk level: NRM0, LRG1, LRG2, LRG3, LRG4, HRG5, HRG6, HRG7, HRG8, HRG9, HRG10, HRG11, HRG12, and HRG13. For this variable, it was considered appropriate to consider triangular membership functions.
Table 10 and
Figure 8 show the details of the membership functions with their respective ranges.