Semi-Automatic Generation of a Fuzzy Inference System in a Reshoring Context

Reshoring can be regarded as offshoring in reverse. While offshoring mainly has been driven by cost aspects, reshoring considers multiple aspects, such as higher quality demands, faster product delivery and product mass-customization. Where to locate manufacturing is usually a purely manual activity that relies on relocation experts, hence, an automated decision-support system would be extremely useful. This paper presents a decision-support system for reshoring decision-making building a fuzzy inference system. The construction and functionality of the fuzzy inference system is briefly outlined and evaluated within a high-cost environment considering six specific reshoring decision criteria, namely cost, quality, time, flexibility, innovation and sustainability. A challenge in fuzzy logic relates to the construction of the so called fuzzy inference rules. In the relocation domain, fuzzy inference rules represent the knowledge and competence of relocation experts and are usually generated manually by the same experts. This paper presents a solution where fuzzy inference rules are automatically generated applying one hundred reshoring scenarios as input data. Another important aspect in fuzzy logic relates to the membership functions. These are mostly manually defined but, in this paper, a semi-automatic approach is presented. The reshoring decision recommendations produced by the semi-automatically configured fuzzy inference system are shown to be as accurate as those of a manually configured fuzzy inference system.


Introduction
Decision-making is a complex task that has a history of being a manual activity. The objective is to make correct and resilient decisions [1] based on incomplete and erroneous information [2]. One situation that is common in manufacturing is to decide "where to locate production". In the past, this has often ended up in an outsourcing and/or offshoring decision induced by a desire to reduce manufacturing cost and especially labor cost [3]. In hindsight, some of these decisions have been less fortunate than initially calculated due to inaccurate information [4] and sometimes also caused by not so robust decision-making frameworks [5].
Over time, other aspects than pure (labor) cost have emerged as being more important, for example increased production flexibility, shorter lead times and higher quality demands [6]. This has put the light on the reverse to offshoring, namely nearshoring or reshoring [7]. But the core problem remains, to manually make complex decisions based on inaccurate information. Hence, these complex decision-making situations calls for a digitized and automated decision-support tool or platform, as shown in [8].
One formal method, known as fuzzy logic, is well suited for the decision-making domain [9]. Apart from having the capacity of modeling and emulating the internal decision process of a human expert, fuzzy logic has the advantage of lacking the expert's disposition of making irrational or even erroneous decisions. To create a digitized decision-support tool, fuzzy logic is implemented in something called a fuzzy inference system (FIS). Two key components of a FIS are fuzzy inference rules and membership functions. The fuzzy inference rules emulate the knowledge and competence of domain experts, in this paper represented by reshoring experts. The membership functions, on the other hand, represent something called linguistic labels [10], in this paper indicating the propensity of a reshoring decision criterion, such as quality, to impact on the final reshoring decision.
Both the fuzzy inference rules and the membership functions are mostly manually generated. To overcome this challenge, a combined automatic/semi-automatic solution is presented in this paper. To demonstrate the procedure, a FIS for reshoring decisionmaking is presented. The more intrinsic details of the FIS are explained in [8]. The main contribution of this paper is to demonstrate the benefits of automatically/semiautomatically generated fuzzy inference rules and membership functions with the help of input data in the form of reshoring decision scenarios with an origin in a high-cost environment. The decision recommendations, that is, the output from the system, are presented and compared to those of professionals competent in the reshoring domain, to validate the accuracy and performance of the FIS. Preliminary reshoring decision results indicate a similar accuracy and performance to those of manually inferred equivalents.
The remainder of the paper is structured as follows. Section 1 presents the basic concepts behind a fuzzy logic system and briefly outlines some different methods to create membership functions as well as fuzzy inference rules. Section 2 presents the five stages that need to be developed in order to create a FIS and outlines the details behind the generation of the membership functions and the fuzzy inference rules. A case study forms the basis for demonstrating the usefulness of creating a FIS. The accuracy and performance of the FIS are presented and discussed in section 3, and in section 4 the paper ends with some concluding remarks and possible future research directions.

Literature review
The following section briefly introduces the five key components (or units) that make up the fuzzy inference system that establish the platform on which the reshoring decisionmaking system is constructed. Two of the five units are of special interest in this paper, that is, the database, that incorporates the membership functions, and the rule base, that incorporates the fuzzy inference rules.

Fuzzy inference system
The decision-making platform presented in this paper is implemented as a FIS. The FIS is made up of five functional units, that is, the fuzzifier, the database, the rule base, the decision-making unit and the defuzzifier (see Figure 1 further on). From the point of view of this paper, the key components are the database and the rule base.
The fuzzifier transforms crisp inputs into correlative linguistic variables [10]. In this paper, a linguistic variable is equivalent to a relocation criterion, such as cost or quality.
The possible values of a linguistic variable are not expressed by numbers but instead by words [9]. A linguistic variable consists of two or more linguistic labels.
The database contains membership functions. A membership function is a fuzzy set that represents a linguistic label [10], in this paper made up by the words negative, neutral or positive. Typical forms of a fuzzy set are triangular, trapezoidal, Gaussian or Sfunction.
The rule base contains fuzzy inference (or if-then) rules. The design of fuzzy inference rules is the cornerstone in the development of a FIS [11]. It is common to involve domain experts in the design as they possess a profound in-depth domain knowledge. The fuzzy inference rules are linguistically readable and interpretable and mimics the human thinking related to relationships and structural dependencies in a system.
The decision-making unit performs inference operations on the rules in the rule base to determine a fuzzy output [12]. The inference operations on fuzzy sets are operations by which several fuzzy sets (called the antecedents) are combined in a desirable way to produce a single fuzzy set (called the consequent).
The defuzzifier transforms the fuzzy result, that is, the consequent, into a crisp output. This procedure includes the rounding of the fuzzy result into a single scalar equivalent (that is, the conversion of the fuzzy result, represented by a membership function, into a real number or even an integer).

Membership function generation
A fundamental issue, due to its direct impact on the result generated by the FIS, is the definition of the linguistic labels, or membership functions, for a given domain in terms of their shape, quantity and distribution. In continuation, a small selection of methods to manually or automatically generate membership functions are presented.

Manual methods
The most straightforward method is to manually create membership functions with the help of domain experts that validate the logic behind the functions and the accuracy of the results. The shape, or distribution, of the membership functions is usually chosen by the same experts and depends on their personal preferences based on previous experiences. Unfortunately, there exist no general rules or guidelines for these tasks that are applicable to arbitrary domains [13]. Regarding the allocation of the membership functions, mostly a uniform allocation is applied, that is, all membership functions are evenly distributed in the domain of a specific linguistic variable. As far as the number of membership functions for a specific linguistic variable is concerned, it usually runs from two up to a maximum of seven. More than seven would make it too difficult to handle, even for a domain expert [14].

Automatic methods
The use of genetic algorithms was proposed by [15] to adjust a clustering process which dynamically tunes fuzzy sets for the task of generating association rules. The goal when using genetic algorithms is to cluster the values of quantitative attributes into fuzzy sets with respect to a given fitness evaluation criterion. Methods based on genetic algorithms, however, tend to be computationally expensive.
The use of artificial neural networks has also been explored for the definition of fuzzy membership functions. In [16] a procedure of knowledge extraction to identify the structure and parameters of a fuzzy rule base using a two-phase neural network was employed. Neural networks, however, have the drawback of not being interpretable.

Fuzzy inference rule generation
Another very important part of a FIS are the fuzzy inference rules and there exist several different methods to generate these [11]. Two main ways to create fuzzy inference rules are to do it manually, relying on domain experts, or to do it automatically, relying on training data. In continuation, a few examples of how to manually or automatically generate fuzzy inference rules are presented.

Manual methods
The most straightforward approach to create fuzzy inference rules is to manually create the rules with the help of domain experts that can validate the logic behind the rules and the reasonability and accuracy of the inferred knowledge and results [17]. If this approach is chosen, the simplest way is to generate 'all' possible combinations of inference rules [18] but this could lead to a complexity explosion resulting in too many rules.
A way around the problem with an unmanageable number of fuzzy inference rules is to automatically assign 'correct' consequents to the rules. The results presented in [8] indicate that linguistic variable weights is a viable approach to reduce complexity while still providing accurate results that coincide with those provided by domain experts.
Kaynak et al. [19] presented a survey of several possible methods to reduce the number of fuzzy inference rules by removing redundant rules. Xiong and Litz [20] presented a method using a genetic algorithm to reduce the number of rules.
The opposite approach to that of creating 'all' possible fuzzy inference rules is to only create the 'necessary' rules, that is, those rules that are relevant to the problem at hand, rules that are more intuitive to a domain expert and that produce reasonably good results [8,19,20]. This approach, however, can lead to inconsistencies between the rules.
A way around the problem with inconsistent rules is to create only a limited number of so-called high-level rules that are not overlapping [8]. High-level rules drastically reduce the complexity imposed on the domain experts as only a limited number of rules need to be designed and evaluated. In a subsequent step the high-level rules are automatically transformed into fuzzy inference rules, without having any inconsistency issues.

Automatic methods
Instead of having to rely on human experts, a semi-automatic or automatic extraction of fuzzy inference rules from a set of training data could be advantageous. Wu et al. [21] presented a method to automatically generate fuzzy inference rules from sample patterns using generalized dynamic fuzzy neural networks.
An example of an adaptive fuzzy system was presented in [22]. The authors described a selection-reduction rule base learning method. In the selection stage, the most relevant rules from each input subspace were identified in a five-step procedure.
Once the procedure terminated, an optimized version of a fuzzy rule base was obtained. In the reduction stage, the fuzzy rule base was pruned, which means that a reduced fuzzy rule base was obtained that complied with a predefined level of accuracy while, at the same time, the overall interpretability of the fuzzy logic system increased.

Fuzzy inference system for reshoring decision-making
This section outlines the process of defining a FIS representing a reshoring decisionsupport system. The developed decision-support system is based on knowledge from academic reshoring domain experts with an in-dept knowledge of reshoring strategies based on several previous research projects with industrial partners having performed reshoring activities. The system was created using the MATLAB® (Matlab Version 2019b) Fuzzy Logic Toolbox. The implementation consists of five steps, described in continuation and in order of execution, each carried out manually or semi-automatically (by fuzzy logic experts with the occasional involvement of reshoring experts) or automatically. A case study based on the input from reshoring experts is applied and the results are presented in section 3.

Define linguistic variables
First, the linguistic variables, that is, the relocation criteria, need to be defined [10]. A relocation criterion is a factor that has an impact on a reshoring decision and is identified among reshoring drivers, enablers and barriers [23,24]. The six relocation criteria used in this paper are: cost, quality, time, flexibility, innovation and sustainability [8]. The output criterion indicates whether a specific combination of input criteria (called input scenarios further on) provides a specific reshoring evaluation recommendation (that is, output = 'evaluate' or output = 'do-not-evaluate').

Define linguistic labels
Second, the linguistic labels need to be defined [10]. In this paper, relative linguistic labels, that is, negative-neutral-positive, have been applied, as in [8]. The same three labels are applied to all six criteria.

Define membership functions
Third, the membership functions need to be defined [10]. When defining membership functions, three questions should be answered, namely: 1) the number of linguistic labels per linguistic variable, 2) the shape (that is, the function) of the membership functions, and 3) the parameters defining the membership functions (that is, the number and distribution). The three questions can be answered by domain experts (that is, manually) or by extracting the answers from input data (that is, automatically) or a combination thereof (that is, semi-automatically). In situations where input data is abundant, all three questions can usually be answered through an automatic procedure (see, for example, [25]). In this study, however, the membership functions were semi-automatically created making use of 100 reshoring decision scenarios. A scenario consists of input values for the 6 criteria previously presented, ranging from -5 to +5 where a -5 indicates that the criterion would be affected in a very negative way if reshoring should take place while a +5 indicates the complete opposite. A higher positive (or negative) output value provides a stronger indication whether to proceed with a possible reshoring evaluation process (or not). A reshoring recommendation value of 0 < x +5 indicates that it could be beneficial to proceed with the reshoring evaluation process while a value of -5 x 0 indicates that it is not beneficial to proceed with the reshoring evaluation process. The procedure to generate the membership functions consists of three steps: 1. Define the number of linguistic labels per linguistic variable. Three relative linguistic labels (negative, neutral, positive) were manually specified. The six input linguistic variables (or criteria) are all represented by the same three membership functions, as described in the next step. Each of the membership functions represents a linguistic label, that is, 'negative', 'neutral' or 'positive'. The singleton output linguistic variable, evaluation, is represented by two linguistic labels, that is, 'do-not-evaluate' or 'evaluate'.
2. Define the shape of the membership functions. The Gaussian distribution was manually chosen for the three membership functions for each of the linguistic labels as the reshoring domain experts considered the Gaussian distribution to be the most adequate for the specific problem domain. The parameters of the Gaussian distribution are ı, which controls the width of the 'bell' of the curve, and ȝ, which defines the position of the center of the curve peak. As the input data in the form of 100 reshoring scenarios (n = [1,100]) can be considered only to be a sample, the probability density function f is: The distribution of the membership functions could have been automatically calculated using the input data but having exact representations of the membership functions was not deemed necessary from an accuracy point of view. The two membership functions for the output variable were chosen to have a triangular distribution for reasons of simplicity. Furthermore, there exist no overlap between the two membership functions as there exist no middle solution; either a recommendation is to 'evaluate' or 'do-not-evaluate'.
3. Identify the membership functions' parameters. The parameters ı and ȝ were calculated using the Maximum-Likelihood Estimation (MLE) applying the following two formulas: on the data sets (that is, the 100 reshoring scenarios). Hence, the calculations identified that ı negative = 2.5, ı positive = 2.5 and ı neutral = 0.8. The values of ȝ, on the other hand, were manually fixed due to simple observations, that is, 'neutral' has to be positioned in the middle of the defined range [-5,+5], thus ȝ neutral = 0, and 'negative' and 'positive' cannot pass the limits of the defined range, thus, ȝ negative = -5 and ȝ positive = +5, respectively.

Define fuzzy inference rules
Fourth, the fuzzy inference rules need to be defined. In this study, the fuzzy inference rules were semi-automatically created using one hundred reshoring decisions scenarios as input applying a method consisting of three steps, as described in [26]. The method is a one-pass method which means that it uses the test data once and then directly generates the fuzzy inference rules. The three steps are presented in continuation and in more detail in [27].
Step 1 and 2 correspond to the selection stage while step 3 corresponds to the reduction stage (see sub-section 1.3). The method is simple and straightforward as it does not require any time-consuming training. The three steps in the fuzzy inference rules generation procedure are: 1. Generate a rule for each input-output data pair. Input(x 1 :cost, x 2 :quality, x 3 :time, x 4 :flexibility, x 5 :innovation, x 6 :sustainability) -Output(y:evaluation), that is, the 100 reshoring scenarios (Input) and the results provided by five reshoring experts (Output), where i = [1,100].
, ȝ E ‫ݔ(‬ ହ ) and ȝ F ‫ݔ(‬ ) are membership functions with the maximum membership degree for each value, respectively.
3. Generate a final list of rules. Initially, one rule was created from each data point, that is, the 100 scenarios (step 1). Then, if there are more than one rule with the same antecedent, the rule that has the maximum degree (step 2) is selected for the final list, thus, four rules were removed (step 3). Hence, all in all, 96 fuzzy inference rules were created.

Configure the fuzzy inference system
Fifth, and finally, the FIS needs to be configured. Once all the parts of the fuzzy logic system are defined, the system was implemented in MATLAB® (Matlab Version 2019b) Fuzzy Logic Toolbox. In this paper the following parameters where chosen for the configuration: Linguistic variables: cost, quality, time, flexibility, innovation, sustainability; Linguistic labels: negative, neutral, positive; do-not-evaluate, evaluate; Membership functions: Gaussian and triangular; Fuzzy operator: and (that is, minimum); Fuzzy inference rules: 96 unique rules; Implication: min; Aggregation: max; Defuzzification: centroid. The selected Implication method was 'min', which truncates the fuzzy output set. The selected Aggregation method was 'max', which means that the strongest rule 'wins', that is, the result is the maximum level of firing. The centroid Defuzzification method is the most widely used method and was therefore selected.  Figure 1 illustrates the complete FIS together with the input data (reshoring scenarios), the membership function calculations (converting the reshoring scenarios into data that is entered into the database), the fuzzy inference rule calculations (converting the reshoring scenarios into data that is entered into the rule base) and the output (in the form of reshoring decision recommendations).

Results
The goal of the study presented in this paper was to demonstrate the possibilities of a semi-automatically and automatically configured reshoring decision-support system in the form of a FIS in relation to the time to configure the system and at the same time uphold the accuracy of the produced reshoring decision recommendations. Preliminary results indicate that the time to configure the FIS will be reduced due to two main factors: 1) the time to physically configure the FIS is reduced when moving from a completely manual configuration of a FIS, 2) as complexity goes up with an increased number of linguistic variables, labels and especially input data in the form of reshoring scenarios, so does the difficulties for a reshoring expert to configure the FIS which directly has a negative impact on the time to configure the FIS.
The accuracy of the results produced in this study was measured using two measures, Mean absolute error (MAE) and Correlation coefficient (R). MAE refers to the resulting errors of measuring the difference between two continuous variables and was 0.94 in this study while the MAE scaled by the Evaluation mean was 26.11%. Correlation is a statistical method used to assess a possible linear association between two continuous variables, in this study made up of the Output values and the Target values. The results indicate that the value of a correlation coefficient, R, was roughly 0.97 (Figure 2, where the dotted line corresponds to 100% accuracy while the blue solid line is the actual, estimated accuracy), thus indicating a very high positive correlation (accordingly to [28]).

Concluding remarks and future research
Decision-making, where reshoring decision-making is a subset, is a difficult and critical task as it often must rely on incomplete and erroneous information [2]. This paper has presented a tool based on fuzzy logic where the semi-automatically created membership functions and fuzzy inference rules for a reshoring decision-support system using 100 reshoring scenarios as input was presented. The results indicate that the application of fuzzy logic to reshoring decision-making issues is viable and that the developed decisionsupport system is useful to management when making relocation decisions as highly reliable relocation decision recommendations are generated while at the same time reducing the time to implement the system.
Potential future research could evolve around the fully automated generation of membership functions, for example, as described in [25]. Furthermore, future cooperation with industry stakeholders that have performed, or are currently evaluating reshoring, will provide more extensive test data for the fuzzy logic reshoring decision process and the following evaluation of the reshoring decision recommendations. Of special interest will be the incrementation of the size of input data while measuring the reduction in time when configuring the reshoring decision-support system.