Defuzzification Methods Comparison of Mamdani Fuzzy Inference System in Predicting Tofu Production

One of the tofu-producing companies in Kupang City is Bintang Oesapa. With the Covid-19 pandemic, the factory needs to reconsider the amount of production by taking into account the unpredictability of demand and resources to minimize losses due to excessive accumulation or shortages of supplies. In determining the amount of production, Mamdani’s Fuzzy Inference System (FIS) can be used, which is a method for the analysis of an uncertain system. This method has three stages in the process of decision making, namely fuzzification, inferencing and defuzzification. In the defuzzification stage, the FIS Mamdani has five methods, namely Centroid, Bisector, Mean of Maximum (MOM), Smallest of Maximum (SOM), and Largest of Maximum (LOM). This study discusses an application of FIS Mamdani with five defuzzification methods for determining daily tofu production. The purpose of this study is to offer a solution by first comparing the five defuzzification methods in assessing the amount of tofu production at the Bintang Oesapa factory and then determining that which is most appropriate. The input variables used in this research are the amount of demand and the amount of available stock, while the amount of production is our variable of interest. The results showed that the best defuzzification method was the MOM method with an accuracy level of 94.73% and a small error value, 5.27%. The MOM defuzzification is expected to aid decision makers in determining the best amount of production during the pandemic.


A. INTRODUCTION
The current Covid-19 pandemic has had adverse effects on the national economy and hence East Nusa Tenggara as well. The pandemic can precipitate a large economic crisis, which has been marked by the cessation of production activities at various companies, the decline in public consumption levels and consumer confidence index.
The Covid-19 pandemic has urged Indonesian government to implement a Large-Scale Social Restriction (LSSR) policy. This policy will cause the economy in Indonesia to decline, and especially has a big impact on Micro, Small and Medium Enterprises (MSMEs) (Bahtiar, 2021). One of the MSMEs operating under Covid-19 is the Bintang Oesapa Tofu Factory MSMEs which is located in Kupang City, East Nusa Tenggara.
The Bintang Oesapa Tofu Factory is one of the many factories that produce tofu in Kupang City. In the tofu production process, the factory produces according to market demand. Based on the interview process with the factory, it is known that on average, it can produce approximately 40,000 pieces in a day. However, due to the pandemic, production has been drastically reduced to merely 20,000-30,000 pieces per day. This is because the remaining stock is around 1000-6000 pieces per day. The Bintang Oesapa Tofu Factory needs a plan to determine the amount of production such that market demand can be met and that profits remain optimal.
Maximum profit is achieved from maximum sales. Maximum sales means being able to meet existing demand. If the amount of goods/service provided by the company is less than the demand, the company will lose the opportunity to get maximum profit. Conversely, if amount of goods/service offered is much more than demand, the company will experience losses. Therefore, planning the amount of production in a company is very important in order to meet market demand and in the right amount. Factors that need to be considered in determining the number of products include: the amount of leftovers from previous period and the estimated demand for the next period (Abrori and Primahayu, 2015). During this pandemic, of course, these factors become uncertain or erratic.
Fuzzy set theory is a method for the analysis of uncertain systems which has more than one method in calculating the estimation of a case. In estimating the amount of tofu production at the Bintang Oesapa tofu factory, no prediction method was used previously, especially the fuzzy set theory method. The decision-making process using fuzzy set theory is called the Fuzzy Inference System (FIS). There are 3 FIS methods that can be used in determining the final decision of a problem, namely the Tsukamoto Method, the Mamdani Method and the Sugeno Method (Priyo, 2017). The three methods generally has the same stages, namely fuzzification, inferencing and defuzzification, but have a different calculation method for each stage. (Rahakbauw, 2015) applies the FIS Sugeno method to predict the amount of bread production by paying attention to inventory data and requested data and an accuracy rate of 86.92%. Then (Rahakbauw et al., 2019) applied the Mamdani FIS method to predict the amount of rubber production by taking into account the availability of data and the requested data and an accuracy rate of 87.83%. Meanwhile, (Mada et al., 2021) compared the predictions for the amount of brick production with the Mamdani FIS and Tsukamoto FIS methods and obtained an accuracy of 99.96% for the Mamdani FIS method and 99.92% for the Tsukamoto FIS method.
In the decision-making process, especially at the defuzzification stage, the Mamdani FIS method has five methods that can be used, namely Centroid, Bisektor, Mean of Maximum (MOM), Smallest of Maximum (SOM), Largest of Maximum (LOM) (Sutikno, 2011). So far, the most frequently used defuzzification method is the Centroid method. There are several previous studies such as (Wardani et al., 2017) in predicting the amount of palm oil production, (Santya et al., 2017) in predicting the amount of banana chips production, (Sari, 2021) in predicting the amount of salt production, (Susetyo et al., 2020) in predicting t-shirt production, (Sahulata et al., 2020) and (Rianto and Manurung, 2022) in predicting the amount of bread production, all using the Centroid defuzzification method of the Mamdani. Hence, we may ask why in production always use the Centroid Mamdani type in defuzzification method? What about the other four Mamdani defuzzification methods?
This research aims to compare the amount of production calculated by the five Mamdani defuzzification methods. To determine the best method, the magnitude of error from the prediction results of the five methods will be calculated using the Mean Absolute Percentage Error (MAPE) formula. The smaller the MAPE value obtained, the better the prediction results (Yusuf et al., 2017).

B. LITERATURE REVIEW 1. Fuzzy Set
In (Rahakbauw, 2015), it has been explained that the concept of fuzzy set was first introduced by Prof. Lofti A. Zadeh of UC Berkley, USA in 1965 with the following definition. Definition 1. Let X be a set. A fuzzy subset A of X is a subset of X whose membership is defined through a function which associates an element x ∈ X to a real number µ A (x) in [0, 1]. The value µ A (x) indicates the degree of membership of x in A. A fuzzy set A is written as follows: The pair (x, µ A (x) reads x has the degree of membership µ A (x).

Membership Function
In this research, we used three types of membership functions; a. Linearly Increasing Membership Function Definition 2. (Mada et al., 2021) A membership function µ is said to be linearly increasing (on (a, b)) if it can be represented as the following For more details, the geometric shape of this function can be seen in Figure 1(a) b. Linearly Decreasing Membership Function Definition 3. (Mada et al., 2021) A membership function µ is said to be linearly decreasing (on (a, b)) if it satisfies the following For more details, the geometric shape of this function can be seen in Figure 1(b)

c. Triangular Membership Function
Definition 4. (Mada et al., 2021) A membership function µ is said to be triangular (on (a, b)) if it can be written as For more details, the geometric shape of this function can be seen in Figure 1(c)

Fuzzy Inference System (FIS)
Fuzzy inference is the process of mapping a given input space into an output space using fuzzy set theory. From this mapping process, the basis of the decisions made or the existing patterns can be seen.
According to (Priyo, 2017), in general, there are several stages needed for designing a fuzzy system, namely: a. Fuzzification is a process of changing non-fuzzy variables (numeric variables) into fuzzy variables (linguistic variables) using appropriate membership functions. b. Inferencing Stage (Rule Base). At this stage, rules are made which will be used as a reference in determining the output of the fuzzy system. The rules produced are in the form of If...And...Then... which is a combination of input variables and output variables. c. Defuzzification is the process of converting fuzzy data into numerical data as the final decision.
There are 3 FIS methods, namely the Tsukamoto, Mamdani and Sugeno methods. In this study, only the Mamdani method will be discussed.

Mamdani Fuzzy Inference System
This method was first introduced by Ebrahim Mamdani in 1975. The creation of this method was motivated by the work of Lotfi Zadeh (1973) on the Fuzzy algorithm for complex systems and was used in the decision-making process (Sari, 2021).
The Mamdani method is a type of fuzzy inference where the fuzzy sets resulted from each rule are combined using aggregation operator and produces a fuzzy set which is then defuzzified to produce a certain output from a system. The output requires several stages, including:

a. Generating The Fuzzy Sets
In the Mamdani method, both input and output variables are divided into one or more fuzzy sets (Sari, 2021).
b. Applying Implication Function (Sari, 2021) states that in the Mamdani method, the function used is the Min function can be written as: c. Composing The Rules Unlike monotonic reasoning, if the system consists of several rules, then inference is obtained from the collection and correlation between rules. There are 3 methods used in performing fuzzy system inference, namely max, additive and probabilistic OR (probor).
The Max (Maximum) method takes the solution of the fuzzy set obtained by taking the maximum value of the rule, then using it to modify the fuzzy area, and applying it to the output using the OR (union) operator. If all propositions have been estimated, then the output will contain a fuzzy set that reflects the contribution of each proportion (Sari, 2021). In general it can be written as: d. Defuzzification There are several defuzzification methods on MAMDANI composing rules (Sutikno, 2011); In the centroid method, the crisp solution is obtained by taking the center point of the fuzzy area. In general, it can be written as: For continuous universe of discourse (Generally for nonlinear cases), For discrete universe of discourse, In the bisector method, the crisp solution is obtained by taking the domain which has a value from the number of membership values in the fuzzy area. Generally this is written In the MOM method, the crisp solution is obtained by taking the average value of the domain that has the maximum membership value − Largest of Maximum (LOM) Method In the LOM method, the maximum solution is obtained by taking the largest value from the domain that has the maximum membership value. − Smallest of Maximum (LOM) Method In the SOM method, the crisp solution is obtained by taking the smallest value from the domain that has the maximum membership value.

Mean Absolute Percentage Error (MAPE)
According to (Wardani et al., 2017), forecasting techniques are not always appropriate because they are not necessarily in accordance with the nature of the data. Therefore, it is necessary to evaluate forecasting so that it can be known whether the forecasting technique used is appropriate or not, so that a more precise forecasting technique can be selected and determined by setting tolerance limits for deviations that occur.
In principle, forecasting evaluation is done by predicting the results of what actually happened. The use of forecasting techniques that produce deviations is the most suitable forecasting technique to use.
The magnitude of the forecast error is calculated by subtracting the real data from the estimated size. In calculating the forecast error, the Means Absolute Percentage Error (MAPE) is used, which is the average absolute percentage of a forecast: where N = the number of forecasting periods, X t = the true value at time t, X t = the forecasting value at time t. According to (Azmi et al., 2020), the forecasting ability is very good if it has a MAPE value of less than 10% and has good forecasting ability if the MAPE value is less than 20%.

C. RESEARCH METHOD 1. Place and Funding Sources
The research was conducted for 2 months (January 2022 -February 2022). The type of data used in this research is secondary, obtained from the Bintang Oesapa Tofu Factory. Data regarding demand and supply taken is daily data starting from January 02, 2022 to February 10, 2022 and several days for data processing.

Data Identification
Data identification was carried out to determine the variables and the universe of discourse for calculations and problem analysis. This process is detail explained in the results and discussion chapter.

Data Processing
Data processing was carried out using the five Mamdani FIS defuzzification methods with Matlab R2013a software. Subsequently, the magnitude of the error for each defuzzification method is calculated using MAPE and the accuracy of each defuzzification method is determined.

Drawing Conclusion
The FIS method and the model are said to be adequate if it has the smallest predicting error value. The error rates are calculated based on Mean Absolute Percentage Error (MAPE).

D. RESULT AND DISCUSSION
Based on the data collection process regarding the data on the amount of tofu production that is influenced by demand and supply, the data obtained are as presented in Table 1.

Fuzzification
It can be seen from Table 1 that from 2 January 2022 to 10 February 2022, the highest demand was on 23 January with a total of 28,800 pieces, while the least was on 4 February with a mere 17,200 pieces. Then the highest supply was on 2 February with 6,400 pieces in total, and the least supply was on 6 January with only 600 pieces. As for productions, the highest was on 24 January with a total of 32,800 pieces, while the minimum was on 8 January with 21,200 pieces. Hence, based on the data of least and most of each of the variables above, the universe of discourse for these variables can be defined as shown in Table 2. Then, for each of the variables, three fuzzy sets are constructed; Low, Medium, and High, with their respective domains also presented in Table 2. Based of equations (3), (4) and (5), the membership functions for demand, supply and production are defined as follows: x ≤ 23, 000 x−23,000 5,800 ; 23, 000 ≤ x ≤ 28, 800 1 ; x ≥ 28, 800 The geometric representation of the membership function of the three fuzzy sets for demand is presented in Figure 2(a). Furthermore, the membership function for the stock variable is defined in the following way: x−3,500 2,900 ; 3, 500 ≤ x ≤ 6, 400 1 ; x ≥ 6, 400 The geometric representation of the membership functions of the three fuzzy sets for supply is presented in Figure 2(b). Next, the membership function for the production variable is defined as follows: And the geometric representation of the membership functions of the three fuzzy sets for the productions is presented in Figure 2(c).
As an illustration, take the data from Table 1  category, the supply is in of low-and-medium-stock fuzzy set, while the production is in the low-production fuzzy set category. By using the membership functions (12), (15), (16) and (18), the degrees of membership for each of these numbers have also been obtained. Their geometric representations can be seen in Figure 2.

Inferencing (Rule based)
At this stage, rules are made which will be used as a reference in determining the output of the fuzzy system. The rule in question is in the form of If...And...Then... which is a combination of 3 variables (2 input variables and 1 output variable). At the stage of forming fuzzy sets, it is known that each variable has 3 fuzzy sets, namely Low, Medium and High fuzzy sets. So the number of rules that can be made in this case is obtained from 3 3 = 27 rules. However, to simplify the calculations and to make the rules more representative, the rules are based on the data that has been obtained (Table 1). So, based on the data in Table 1, the previous 27 rules were reduced to 18 rules that represent every situation that might occur at the Bintang Oesapa Tofu Factory.
With the help of Matlab R2013a software, the 18 rules are as follows: For example, at the fuzzification stage, the degree of membership of low-demand for x = 18, 400 is 0.79, the degree of membership of low-stock for x = 2, 200 is 0.1, the degree of membership of medium-stock for x = 2, 200 is 0.45 and The degree of membership of the low-production for x = 22, 400 is 0, 79. Based on the fuzzy set that corresponds to each data, there are 2 possible rules, namely [R1] and [R3]. Next, the α − predicate value will be searched for each rule using the Min function in the equation 6.
[R1] : If (DEMAND is L) and (STOCK is L) then (PRODUCTION is L)

Defuzzification
In this stage, the final fuzzy data is transformed into crisp data. The defuzzification process is performed by using the five methods mentioned above. For example, based on the process of fuzzification and inferencing of data on January 2, 2022, we get 2 values of z namely z 1 = 24, 390 with µ z1 = 0, 45 and z 2 = 2, 420 with µ z2 = 0, 1. The defuzzification process generates z * = 23, 400 with Centroid method, z * = 23, 200 with Bisector method, z * = 22, 900 with MOM method, z * = 27, 500 with LOM method, and z * = 18, 400 with SOM method. The crisp data obtained from the defuzzification is the compared to the actual data in Table 1. The comparison result is presented in Table 3. Based on the calculation comparison process in Table 3, several comparisons of the five Mamdani FIS defuzzification methods were obtained based on the level of accuracy, error in analysis, manual calculation time and calculation complexity level. The comparison is presented in Table 4  The level of accuracy presented in Table 4 was calculated using MAPE formula in equation (11). Based on the comparison result in Table 4, for the case of determining the amount of tofu production at the Bintang Oesapa Tofu Factory by considering the stock and demand obtained that the MOM method has a higher level of accuracy than the Centroid method with the difference in accuracy between the two is 0, 56%. Because each case has its own characteristics, it is better if the Mamdani method does not use the centroid method directly as the defuzzification method, but instead uses the centroid method as a defuzzification method it is necessary to review other defuzzification methods first. Based on the results of the calculations in Table 4 it can be said that that for this case, the accuracy of the calculation results of the Mamdani method ranges from 76% − 95% which can be said to be very good or very similar to the decision making by the Bintang Oesapa Tofu Factory. This is in line with the statement (Kaur and Kaur, 2012) in their research, Mamdani method is widely accepted for capturing expert knowledge. It allows us to describe the expertise in more intuitive, more human-like manner.

E. CONCLUSION AND SUGGESTION
From data processing and relevant journals, we conclude that the best FIS Mamdani defuzzification method to predict the amount of tofu production at the Bintang Oesapa Tofu Factory was the Mean of Maximum (MOM) defuzzification method. The first reason is that the accuracy value of the other 5 methods is 94.73% and the value of error or small error is 5.27%. Bisides that, the manual calculations require a substantial amount of time and are not complicated.
Thus, when carrying out the process of determining the production of tofu using the Mamdani fuzzy inference system method, it is highly recommended to use the MOM method in the defuzzification process. Not only in the case of tofu production, this method is also highly recommended for determining the production of other goods.