Introduction

An inventory system controls the level of inventory by deciding how much to order (the level of replenishment) and when to order (reorder point). The purpose of an inventory system is to make decisions concerning the level of inventory that will effect in a desirable balance between holding inventories and the cost related with them (Meredith and Shafer 2011). The inventory level is difficult to deal with because of the number of factors concerned and uncertain events such as unpredictability of demand and supply. A appropriate policy and control system for each type of product is necessary.

Inventory lot-sizing problems are production planning problems with the purpose of deciding the periods when production should happen and the quantities to be made for meeting demand while reducing production and inventory costs. Since the original lot-sizing model presented by Harris in 1913 (Andriolo et al. 2014), most models focus mainly on deterministic static lot-sizing models. Further work (Sommer 1981; Samanta and Al-Araimi 2001) has developed fuzzy lot sizing models, followed by adaptive neuro-fuzzy inference system (ANFIS) (Samanta and Al-Araimi 2003) to fuzzy inventory lot-sizing models. Recently, several literature reviews of lot-sizing models have been presented (Andriolo et al. 2014; Aloulou et al. 2014; Glock et al. 2014).

Inventory lot-sizing models can be divided into three groups which are deterministic models, stochastic models and fuzzy models as illustrated in Fig. 1. Table 1 shows the contributions of the inventory lot-sizing models.

Fig. 1
figure 1

Classification of inventory lot-sizing models. EOQ Economic order quantity, EPQ Economic production quantity, ANN Artificial neural network, ANFIS Adaptive neuro-fuzzy inference system,

figure a
Methods proposed in this research

Table 1 The contributions of the inventory lot-sizing models

Deterministic lot-sizing models

All input data of deterministic lot-sizing models are supposed to be available. These models can be classified into two groups, static and dynamic models. For deterministic static lot-sizing models, the original model was known as Economic Order Quantity (EOQ) or square root formula, with the objective to minimize the sum of inventory holding and ordering costs. The EOQ formula was modified (Taft 1918) by adding ratio between demand rate and production capacity and called Economic Production Quantity (EPQ). Since then many extended researches about EOQ and EPQ have been reported.

For deterministic dynamic lot-sizing models, the goal is to minimise the sum of inventory holding and set up costs, but it permits the demand for products to change over time.

Because the deterministic models assume known parameters, most of the existing literature tries to present an optimal solution of the problem while others present some heuristic approaches in order to achieve desirable results for pragmatic conditions. However, in the real world, there are some uncertain parameters that need to be considered.

Stochastic lot-sizing models

Some input data of stochastic lot-sizing models are defined as probability density functions. These models can be classified into two groups, static and dynamic models. Many stochastic static lot-sizing models are based on EOQ model but have different stochastic information such as lead time, demand, supplier capacity, cost, price etc. Heuristics method (Seneyigit and Erol 2010) for stochastic lot-sizing and EPQ models for deteriorating inventory (Chung et al. 2011; Wee and Widyadana 2012) have been proposed.

Dynamic stochastic lot-sizing models were presented to solve the problem of uncertain demand (Kamal and Sculfort 2007) and normally can be solved by the optimization models such as the Wagner-Whitin (WW) algorithm and the heuristic models such as Silver-Meal (SM) method, part period balancing (PPB), lot for lot (L4L) etc. According to fundamental of probability theory, stochastic inventory models are efficient when the input information of models is known precisely and is obtainable (Chen 2011). In a real world situation, supply data may not exist when required because of random capacity of suppliers, uncertain events or seasonal factors. Meanwhile, some of the uncertainties within the inventory system cannot be taken into account properly by using concepts of probability theory (Tanthatemee and Phruksaphanrat 2012).

Fuzzy lot-sizing models

Fuzzy set theory has been applied to unpredictable inventory problems in non-stochastic judgment. These models can be divided into three groups, mathematical, fuzzy logic and ANFIS models.

For fuzzy mathematical lot-sizing models, many models of fuzzy EOQ models have been proposed. Many researches applied fuzzy sets to demand, deterioration rate, defective rate, lead time, etc, but many of these methods are complex and arduous to accomplish.

Fuzzy logic lot-sizing models have been presented (Samanta and Al-Araimi 2001) for fuzzy demand. A fuzzy simulation of a single item inventory system with variable demand to determine the EOQ with uncertain lead time (Yimer and Demirli 2004) was developed. Other fuzzy logic models considered inventory control of fuzzy demand and stock (Rothstein and Rakityanskaya 2006; Chede et al. 2012) and also demand and lead time uncertainties by fuzzy logic (Kamal and Sculfort 2007). A fuzzy continuous inventory control system for a single item with both uncertain demand and supply has been presented (Tanthatemee and Phruksaphanrat 2012) and later determination of the design range and the effect of trend demand (Aengchuan and Phruksaphanrat 2013). This model saved inventory costs greatly when compared with the conventional stochastic EOQ model, Silver Meal model and Wagner Whitin Model.

For ANFIS lot-sizing models, adaptive neuro-fuzzy inference system and fuzzy logic control have been proposed for fuzzy demand and inventory level (Samanta and Al-Araimi 2003). The ANFIS approach to adaptive inventory control has been applied to single input – single output (Lenart et al. 2012). The set of input values were determined by the expected values of the demand.

Fuzzy mathematical models are complicated and difficult for decision makers to implement in real life situations but fuzzy logic tools are not complicated to implement and modify. However, fuzzy tools should achieve the same as or better than other soft approaches (Azedegan et al. 2011). These characteristics have made fuzzy logic and tools associated with its use quite popular in tackling manufacturing related challenges. Inventory problem is a crucial problem in manufacturing system, which can cause a lot of wastes. Most models are complicated and difficult for the practical use. Many researches focus on a fuzzy mathematical for inventory lot-sizing problem, but there is limited published work regarding applications of the neuro-fuzzy approach to inventory based on FIS + ANN and FIS + ANFIS. Furthermore, consideration of both fuzzy demand and supply by ANN and ANFIS has not been taken into account. So, this research proposes the integrated methodologies of FIS + ANN model and FIS + ANFIS model for choosing of criteria and developing the model of the practical problem with the fuzzy inputs for both demand and supply to the inventory lot-sizing problem.

Inventory system

The relevant elements associated with how much to order are normally concerned with inventory costs and inventory lot-sizing models. The inventory cost consists of holding cost, ordering cost and shortage cost. All inventory models try to reduce the total inventory costs.

Inventory cost

In making any decision with respect to inventories, the following costs must be considered.

Ordering cost is the fixed costs usually related to the production of a lot inside or the placing of an order outside with a vendor.

Holding (or carrying) cost includes the costs for warehouse, transporting, insurances, pilferage, fragility, obsolescence.

Shortage cost. This is usually the sum of the lost profit. It occurs when customer demand cannot be met due to inadequate inventory. There is a trade-off between holding stock to fulfill demand and the costs effecting from stock out.

The case study model considers the total inventory costs as the summation of ordering cost, holding cost and shortage cost.

$$\begin{aligned} TC = mC_{o}+C_{h}Q_{h}+C_{s}Q_{s} \end{aligned}$$
(1)

where TC is the total inventory cost. m is the number of ordering per period. \(C_{o}\) is ordering cost per time. \(C_{h}\) is the holding cost per unit per period. \(C_{s}\) is the shortage cost per unit per period. \(Q_{h}\) is the holding quantity per period and \(Q_{s}\) is the shortage quantity per period.

Static inventory lot-sizing

In a fixed-order-quantity system when inventory approaches a particular level, referred as the reorder point, a fixed quantity is ordered. The EOQ model is extended to the stochastic EOQ model to figure out the problem of unpredictable demand, and is applied when the uncertainties are considered as random that can coped with probability theory. Supposing that the demand is expressed by a normal distribution, determination of how much to order can be calculated (Kamal and Sculfort 2007) by the following equation.

$$\begin{aligned} Q^{*}=EOQ=\sqrt{\frac{2C_o H{\overline{d}} (C_h +C_s )}{C_h C_s }}, \end{aligned}$$
(2)

where \({\overline{d}} \) is the average weekly demand. H is the total length of the planning horizon (number of weeks).

If demand is uncertain, safety stock must be added into the reorder point and the reorder point and the safety stock can be calculated.

$$\begin{aligned}&R={\overline{d}} L+SS, \end{aligned}$$
(3)
$$\begin{aligned}&SS=z\sigma _d \sqrt{L}, \end{aligned}$$
(4)

where R is the unit of reorder point. SS is safety stock. L is lead time. \(\sigma _d \) is the standard deviation of weekly demand. z is the number of standard deviations according to the service level probability.

Fuzzy inference system (FIS)

Fuzzy inference system is a system that is applied to govern the connection between the input and output variables of a system as shown in Fig. 2. There are three distinct types of fuzzy inference systems: Mamdani-type, Sugeno-type and Tsukamoto-type (Castillo and Melin 2008). The main difference between Mamdani and Sugeno resides in the consequence of fuzzy rules. Mamdani-type uses fuzzy sets as rule consequence whereas Sugeno-type uses linear functions as rule consequence. For Tsukamoto-type, the consequent of each fuzzy rule uses a monotonical membership function. In this research Mamdani-type is used.

Fig. 2
figure 2

A scheme of inference fuzzy inventory system

In a fuzzy inference system, the crisp inputs are converted into fuzzy inputs by using fuzzification interface. After fuzzification the rule bases are developed. The rule bases and the database are mutually referred to as the knowledge base. Defuzzification is applied to transform the fuzzy value to the real life value which is the output. FIS is implemented in various applications for both management and manufacturing (Kovac et al. 2013; Nasrollahzadeh and Basiri 2014; Guner and Yumuk 2014; Camastra et al. 2015; Kocyigit 2015).

In this research, fuzzy logic toolbox of MATLAB was applied to the Fuzzy Inventory System (FIS) model to compute order quantity in any time period. The flow chart of all parameters of the inventory system model is illustrated in Fig. 3. The two fuzzy input variables are demand \((D_{i})\) and supply \((S_{i})\). The output variable is order quantity \((Q_{i})\), and is described by linguistic variables. Then the output is entered to the evaluation algorithm as shown in Fig. 4.

Fig. 3
figure 3

The flow chart of the FIS model

Fig. 4
figure 4

The evaluation algorithm of the inventory system model. \(\hbox {Ib}_0\) The beginning inventory at the end period of last year, \(\hbox {Ie}_0\) The ending inventory at the end period of last year, \(\hbox {R}_0\) Reorder point of last year, \(\hbox {R}\) Reorder point of this year, \(\hbox {Ib}_\mathrm{i}\) The beginning inventory at period i of this year, \(\hbox {Ie}_\mathrm{i}\) The ending inventory at period i of this year, \(\hbox {D}_\mathrm{i}\) Demand at period i of this year, \(\hbox {S}_\mathrm{i}\) Supply at period i of this year, \(\hbox {Q}_\mathrm{i}\) Order quantity at period i of this year, \(\hbox {Qs}_\mathrm{i}\) Shortage quantity at period i of this year, \(\hbox {Qo}_\mathrm{i}\) Ordering quantity at period i of this year, \(\hbox {Qh}_\mathrm{i}\) Holding quantity at period i of this year, \(\hbox {Cs}_\mathrm{i}\) Shortage cost at period i of this year Co Ordering cost of this year, \(\hbox {Ch}_\mathrm{i}\) Holding cost at period i of this year

From Fig. 4, the inventory levels, which are the beginning inventory \((I_{b_i } )\) and the end inventory \((I_{e_i } )\) can be determined by output variable \((Q_i )\) and reorder point (R). Then the inventory costs, which are ordering cost \((C_{o_i } )\), holding cost \((C_{h_i } )\) and shortage cost \((C_{s_i } )\) can be calculated by ordering quantity \((Q_{o_i } )\), holding quantity \((Q_{h_i } )\) and shortage quantity \((Q_{s_i } )\), respectively. The total cost per period is determined by the summation of the inventory costs. This fuzzy logic model then generates for the next period and follows this flow chart for each period (\(i = 1, 2, 3,\ldots , n\)). Then the total inventory cost of the model is the summation of the total inventory costs of all periods.

Artificial neural networks (ANN)

Artificial neural networks consist of a number of interlinked cells as neurons with weights running coincidently to initiate artificial intelligence. ANN composes of three layers: input, hidden and output layers. The input and output layers consist of a set of neurons expressing input and output variables. The hidden layer passes the data it receives from the input layer, and transmits a response to the output layer. There is no speculative limit on the number of hidden layers but generally there is just one or two (Sumathi and Paneerselvam 2010). The output layer receives all responses from the hidden layer and generates an output vector. Each layer has a fixed number of processing elements (neurons) which are linked with adjustable weights. These weights are adjusted during the training process until the error is decreased greatly and is acceptable for a specific task. ANN is trained by an appropriate algorithm for a particular problem. Even though a number of training algorithms are convenient, the most well-known is feed-forward back propagation algorithm (Kiran and Rajput 2011). The output of each neuron is computed by multiplying its inputs by a weight vector, summing the results, and adding an activation function to the sum.

$$\begin{aligned} y=F\left( {\sum _{k=1}^l {w_k x_k +b_k } } \right) \end{aligned}$$
(5)

where, F is the activation function, l is the number of neurons in the consecutive layer, \(w_{k }\) is the weight of the respective connection, and \(b_{k}\) is the bias for the neuron. F is ordinarily linear, step, threshold, logarithmic sigmoid (logsig) or hyperbolic tangent sigmoid (tansig) function (Razani et al. 2013). ANN is implemented in various applications such as forecasting of a ground-coupled heat pump performance (Esen et al. 2008a, b), modelling of a solar air heater (Esen et al. 2009), autoregressive control chart pattern recognition (Yang and Zhou 2013), and other applications (Kuo C. et al. 2014; Kuo R. et al. 2014; Tsai and Luo 2014; Jha et al. 2014; Kocyigit 2015; Wang et al. 2015).

Adaptive neuro-fuzzy inference system (ANFIS)

ANFIS unlike FIS, automatically creates sufficient rules concerning input and output data, and uses benefit of the learning capability of neural networks. It is currently one of the effective tools used for pattern recognition, system identification and can generate precise models of systems. This approach does not need expert opinion for modelling and training a system.

Although various applications of the ANFIS have been applied (Azizi et al. 2013; Guneri et al. 2011; Melin et al. 2012), there are few researches applying inventory control in production systems. Jang first initiated the ANFIS method by embedding the fuzzy inference system into the structure of adaptive networks (Jang 1993). An ANFIS provides the mapping relationship between the input and output data by utilizing hybrid learning method to find out the optimal distribution of membership functions (Ying and Pan 2008). In the ANFIS architecture, ANN learning algorithms are applied to define the parameters of fuzzy inference system. A typical architecture of ANFIS is shown in Fig. 5 for modeling of function f(xy). The round nodes describe nodes that are fixed, whereas the rectangular nodes are nodes that have parameters to be learnt or called adaptive nodes. For simplicity, consider a FIS with two inputs (xy) and one output (f). In addition, the rule base of FIS includes two fuzzy if-then rules of Takagi-Sugeno type. The two rules can be represented as:

$$\begin{aligned}&\hbox {Rule 1: if } x\hbox { is }A_{1}\hbox { and }y \hbox { is B}_{1},\hbox { then }f_{1} = p_{1}x + q_{1}y + r_{1}\\&\quad \hbox {Rule 2: if }x\hbox { is A}_{2 } \hbox { and }y\hbox { is B}_{2}, \hbox { then} f_{2} = p_{2}x + q_{2}y + r_{2} \end{aligned}$$

where \(\hbox {A}_{\mathrm{i}}, \hbox {B}_{\mathrm{i}}\) (i=1, 2) are fuzzy sets in the precursor, and \(p_{i}, q_{i}, r_{i}\) (\(i=1,2\)) are the design parameters that are decided during the training process.

Fig. 5
figure 5

ANFIS architecture with two rules

Layer 1: Input nodes. Every node i in this layer is rectangular node with a node function as Eq. (6):

$$\begin{aligned} O_i^1 =\mu _{A_i } (x), \quad i = 1, 2\quad O_i^1 =\mu _{B_i } (y),\quad i = 1, 2 \end{aligned}$$
(6)

where xy are the crisp inputs of node i, and \(A_{i}\), \(B_{i}\) are the linguistic labels identified by membership functions, \(\mu _{A_i } (x)\) and \(\mu _{B_i } (y)\), respectively.

Layer 2: Rule nodes. Every node in this layer expresses the firing strength of a rule by multiplying the entering signals and sending the product out as Eq. (7):

$$\begin{aligned} O_i^2 =\omega _i =\mu _{A_i } (x)\times \mu _{B_i } (y), \quad i = 1, 2. \end{aligned}$$
(7)

Layer 3: Average nodes. The i-th node in this layer computed the average proportion of the i-th rule’s firing strength.

$$\begin{aligned} O_i^3 =\varpi _i =\frac{\omega _i }{\omega _1 +\omega _2 }, \quad i = 1, 2 \end{aligned}$$
(8)

where \(\varpi _i \) is taken as the normalized firing strength.

Layer 4: Consequent nodes. The node function in this layer is expressed by Eq. (9):

$$\begin{aligned} O_i^4 =\varpi _i f_i =\varpi _i (p_i x+q_i y+r_i ), i = 1, 2 \end{aligned}$$
(9)

where \(\varpi _i \) is the output of layer 3, and \(\{p_{i}; q_{i}; r_{i}\}\) is the parameter set. Parameters in this layer are specified to the consequent part of the Segeno fuzzy model.

Layer 5: Output nodes. The single node in this layer calculates the overall output as the total of all entering signals. Consequently, the defuzzification process converts each rule’s fuzzy results into a crisp output in this layer.

$$\begin{aligned} O_i^5 =\sum _{i=1}^2 {\varpi _i f_i =\frac{\varpi _1 f_1 +\varpi _2 f_2 }{\varpi _1 +\varpi _2 }} ,\quad i = 1, 2 \end{aligned}$$
(10)

It is noticed from the ANFIS structure that when the values of the premise parameters are fixed, the overall output can be represented as:

$$\begin{aligned} f= & {} (\varpi _1 x)p_1 +(\varpi _1 y)q_1 +(\varpi _1 )r_1 \nonumber \\&+\,(\varpi _2 x)p_2 +(\varpi _2 y)q_2 +(\varpi _2 )r_2 \end{aligned}$$
(11)

ANFIS combines the gradient descent method and the least square methods to train parameters. Functional signals go onward until layer 4. Then, the resulting parameters are controlled by the least squares method to minimize the error. Furthermore, the assumption parameters are improved by the gradient descent in the backward pass. ANFIS is implemented in various applications such as modelling a ground-coupled heat pump system (Esen et al. 2008c, d, e), predicting the performance of a refrigeration system (Hosoz et al. 2011), applying for an industrial robot manipulator (Chaudhary et al. 2014), and other applications (Fragiadakis et al. 2014; Yang and Entchev 2014; Gokulachandran and Mohandas 2015; Phootrakornchai and Jiriwibhakorn 2015).

Performance parameters

The performance of the models can be corroborated with the following functions: the coefficient of determination (\(R^{2}\)), the root mean squared error (RMSE) and the mean absolute error (MAE) as described in Eqs. (12), (13) and (14).

$$\begin{aligned} R^{2}= & {} 1-\frac{\sum \limits _{i=1}^n {\left( {A_i -P_i } \right) ^{2}} }{\sum _{i=1}^n {\left( {A_i -{\overline{A}} _{_i } } \right) ^{2}} } \end{aligned}$$
(12)
$$\begin{aligned} RMSE= & {} \sqrt{\frac{\sum \limits _{i=1}^n {\left( {A_i -P_i } \right) ^{2}} }{n}} \end{aligned}$$
(13)
$$\begin{aligned} MAE= & {} \frac{\sum \limits _{i=1}^n {\left| {A_i -P_i } \right| } }{n}, \end{aligned}$$
(14)

where \(P_{i}\) is the predicted values. \(A_{i}\) is the observed values. \({\overline{A}} _i \) is the average of observed set. n is the number of datasets.

\(R^{2}\) represents how much the variability in dependent variables can be interpreted by independent variables, which have value between zero and one. A value for \(R^{2}\) approach to one indicates a good fit of predicting model and a value approach to zero indicates a poor fit. MAE would expose if the results undergo from a bias between the actual and predicting datasets. RMSE is a measure applied to compute the deviation between values predicted by a model and the values observed. RMSE and MAE are non-negative numbers with no upper bound and can be zero only for an ideal model.

Industrial application

The problem of inventory control has been investigated by using a case study of a furniture company in Thailand. The company is a made-to-order manufacturer that produces three main products which are door frames, stairs and plywood doors. Supply and demand of their products are both uncertain. The materials are imported from neighbouring countries and consist of timber woods, shorea obtusa woods, rubber woods and hopea woods. The main materials are timber woods. Availability of these materials is uncertain due to the amount of timber woods based on climate, rainfall and proveniences of supply. Demand varies randomly but both demand and supply can be described by a normal distribution. Presently, a high stock level is maintained to secure against insufficiency. The company guarantees to serve clients with over 95 % of service level efficiency. However, shortages still occur and the total inventory cost is high. These are serious problems for the company. So, FIS model, FIS + ANN model and FIS + ANFIS model were proposed to reduce the total inventory cost and inventory levels, and the results were compared with the conventional stochastic EOQ model. Fifteen data sets from the distribution of historical data of year 1999 to 2014 were investigated. The data sets of the year before 2010 were adjusted due to their tendency demand and for more realistic of the input data sets. From Fig. 6, it can be visualized that the supply of material fluctuated exceedingly compared with demand and caused a shortage in some periods. Ordering cost, holding cost and shortage cost per unit per period of the case study factory were $100, $0.05 and $59, respectively.

Fig. 6
figure 6

Fluctuation of demand and supply in 52 weeks. Note: Demand: mean = 2452 units, SD = 776 units, Supply: mean = 6487 units, SD = 3921 units

FIS for the lot-sizing problem

Fuzzy inputs

Fuzzy inputs are demand and supply. For systems with consequential dynamic variation in a short period of time, triangular or trapezoidal membership functions should be used (Bai and Wang 2006). Fuzzy demand and fuzzy supply, represented by membership functions, \(\mu _{D_i } \) and \(\mu _{S_i } \), respectively, were determined based on inspection and verifying of historical data. Both of them are supposed to be described by three linguistic values; low, medium, high.

The universe of discourse of demand input space was created within the range [\(\hbox {D}_{\mathrm{min}}, \hbox {D}_{\mathrm{max}}\)], where \(\hbox {D}_{\mathrm{min}}\) and \(\hbox {D}_{\mathrm{max}}\) are the minimum and maximum demand that had been ordered respectively. Demand membership functions rely on the parameters (\(\hbox {D}_{\mathrm{min}}\), \({\overline{d}} -\sigma _d, {\overline{d}} , \bar{d}+\sigma _{{d}} , \hbox {D}_{\mathrm{max}}\)) as presented in Fig. 7a. The parameters were created depending on the attributes of a normal distribution of unpredictable demand of the factory. Supply was created on actual data within the range [0, \(\hbox {S}_{\mathrm{max}}\)], where \(\hbox {S}_{\mathrm{max}}\) is the maximum supply from the recent suppliers. Membership functions are presented in Fig. 7b. The parameters (\(0, 0.25\hbox {S}_{\mathrm{max}}, 0.5\hbox {S}_{\mathrm{max}}, 0.75\hbox {S}_{\mathrm{max}}, \hbox {S}_{\mathrm{max}})\) were applied for supply linguistic values.

Fig. 7
figure 7

Input membership functions. a Demand. b supply

Fuzzy outputs

The fuzzy output, order quantity, is constructed and represented by membership functions, \(\mu _{Q_i } \). Fuzzy order quantity is supposed to have three linguistic values; low, medium and high, represented by (\(0, 0.5\hbox {S}_{\mathrm{max}}\)-R, \(0.5\hbox {S}_{\mathrm{max}}, 0.5\hbox {S}_{\mathrm{max}}\)+R, \(\hbox {S}_{\mathrm{max}})\) as presented in Fig. 8, with universe of discourse interval [0, \(\hbox {S}_{\mathrm{max}}\)].

Fig. 8
figure 8

Output membership functions, order quantity (\(\mu _{Q_i }\))

Fuzzy rules

The fuzzy rule is described by a sequence of IF-THEN, directing to algorithms representing what activity or output should be selected in terms of the presently observed information, which involves both input and feedback if a closed-loop control system is used. The guidance to create or construct a set of fuzzy rules is originated on a human being’s knowledge or experience, which depends on each veridical application. A fuzzy IF-THEN rule relates to a condition represented using linguistic variables and fuzzy sets to an output or a conclusion. This IF-THEN rule is extensively applied by the fuzzy inference system to calculate the degree to which the input data matches the stipulation of a rule. Since the outputs, order quantity and reorder point are fuzzy sets, a Mamdani- type inference system is chosen here for estimating and aggregating the fuzzy rules. The IF-THEN rule can be mathematically represented, as proposed by Mandani and Assilian (1975), by Cartesian product of the fuzzy inputs, \(x_{1} \times x_{2}\). The relationship between demand \(x_1 \), supply \(x_2 \) (IFs) and order quantity \(y_1 \) (THEN) are represented by 9 rules as shown in Table 2.

Table 2 The relationship of membership functions for each fuzzy rule

By using the max-min compositional operation, the fuzzy reasoning of these rules produces fuzzy outputs. Fuzzy order quantity (\(\mu _{Q_i } (y_1 )\)) can be represented as

$$\begin{aligned} \mu _{Q_i } (y_1 )=(\mu _{_{D_i } }^1 (x_1 )\wedge \mu _{_{S_i } }^1 (x_2 )\vee ...(\mu _{D_i }^n (x_1 )\wedge \mu _{S_i }^n (x_2 )), \end{aligned}$$
(15)

where \(\wedge \) is the minimum operation and \(\vee \) is the maximum operation. \(D_{\mathrm{i}},S_{i}\) and \(Q_{i }\) are fuzzy subsets identified by the analogous membership functions, i.e., \(\mu _{D_i } ,\mu _{S_i } ,\mu _{Q_i } \).

Actually, the fuzzy output is also a linguistic variable, and this linguistic variable needs to be transformed to the crisp variable through the defuzzification process. For this case study, the central of gravity method is chosen to convert the fuzzy inference output into non-fuzzy values of order quantity, \(y_1^*\). Define rule number as n. The crisp values of order quantity are calculated as

$$\begin{aligned} y_1^*=\frac{\sum \limits _{n=1}^9 {y_1 (\mu _{_{Q_{_i } } }^n (y_1 ))} }{\sum \limits _{n=1}^9 {\mu _{Q_{_i } }^n (y_1 )} },\quad \hbox {for } i = { 1, 2,\ldots , n} \end{aligned}$$
(16)

Designing of input parameters

The proposed FIS model focuses on demand variation by modifying the input membership function parameters with the designed universe of discourse of demand input space within the interval [\(\hbox {D}_{\mathrm{min}},\hbox {D}_{\mathrm{max}}\)]. The demand membership function parameters are selected between (\(\hbox {D}_{\mathrm{min}},\bar{{d}}-0.1\sigma _d ,{\overline{d}},{\overline{d}}+0.1\sigma _d,\hbox {D}_{\mathrm{max}})\) to (\(\hbox {D}_{\mathrm{min}},\bar{{d}}-1.7\sigma _d ,{\overline{d}} , \bar{d} +1.7\sigma _{{d}},\hbox {D}_{\mathrm{max}})\). The first, the third and the fifth parameters are fixed because they are lower bound, midpoint and upper bound of the demand data. The second and the fourth parameters of the multiplier parameters of demand standard deviation (\(\sigma _d )\) are adjusted from 0.1 to 1.7. Fig. 9, compares the calculated average total costs of 15 data sets. The lowest average total cost is at (\(\hbox {D}_{\mathrm{min}},{\overline{d}} -0.2\sigma _d ,{\overline{d}} ,{\overline{d}} +0.2\sigma _d ,\hbox {D}_{\mathrm{max}})\) or in abbreviated format denoted as (\({\overline{d}} \underline{+}0.2\sigma _d )\). Therefore in this case study, the recommended range of the membership function parameters for applying the FIS model should be between the range of (\(\hbox {D}_{\mathrm{min}},{\overline{d}} -0.2\sigma _d ,{\overline{d}} ,{\overline{d}} +0.2\sigma _d ,\hbox {D}_{\mathrm{max}})\) and (\(\hbox {D}_{\mathrm{min}},{\overline{d}} -0.4\sigma _d ,{\overline{d}} ,{\overline{d}} +0.4\sigma _d ,\hbox {D}_{\mathrm{max}})\).

Fig. 9
figure 9

The average total cost of 15 data sets of the proposed FIS model

FIS with ANN for the lot-sizing problem

In this research, the two layer feed-forward with a back propagation learning algorithm was used for the inventory model. The flow chart of FIS + ANN model is shown in Fig. 10. The input data consisted of 52 demand and supply quantities. The output data from FIS model was used as the target data to define the ANN output. To determine with ANN, 42 data were selected for training, 5 data for validation and 5 data for testing. The number of hidden neurons was defined as 5. The model was trained by using Levenberg-Marguardt with back propagation algorithm. Then the output from ANN model was entered into the evaluation algorithm to compute the total inventory cost of each time period. The total inventory cost of the model is the summation of inventory costs for all periods.

Fig. 10
figure 10

The flow chart of FIS + ANN model

FIS with ANFIS for the lot-sizing problem

The flow chart of FIS + ANFIS model is shown in Fig. 11. The output from FIS model was applied as the training and testing data of ANFIS model. There are two inputs for each of the 3 MFs. Then the 9 rules were applied to normalize data and get the constant output for each data period. The result of ANFIS was entered to the evaluation algorithm to compute the total inventory cost for each time period, then summed to give the inventory cost of the model.

Fig. 11
figure 11

The flow chart of FIS + ANFIS model

An algorithm of the model based on ANFIS for the inventory system is tabulated in Fig. 12 showing 3 phases. Similar to ANN, to determine with ANFIS, 42 data were selected for training, 5 data for checking or validation and 5 data for testing. Both demand and supply inputs consisted of three membership functions (MFs). The ANFIS models were developed by using the various shapes of input MFs, trapezoidal and triangular (Trap), Gaussian (Gauss), and bell shape (Bell). To determine ANFIS outputs, a constant order quantity (Q) was selected. In MFs optimization, a hybrid of the least-squares method and the back propagation gradient descent method was employed to imitate a given training data set.

Fig. 12
figure 12

Algorithms based on ANFIS for inventory system

K-fold cross validation method

K-fold validation is an assured method, presented to test generalization capability of ANN methods (Good 1999). This method was used for further estimation of the efficiency of the generated FIS + ANN model and FIS + ANFIS models. In this research, the total 15 data sets were separated into 5 even groups, and then the modelling training were implemented 5 times taking one group out at each time to check the model generality. By this method, the candidate model is examined by the all data. The average accuracy of the models was represented by \(R^{2}\) and RMSE as showed in Table 3. The \(R^{2}\) of all models have achieved greater than 0.9, which verify goodness of the model performance.

Table 3 The K-fold cross validation results of each model

Results and discussion

The inventory models of both fuzzy demand and supply have been modelled analytically as well as with ANN and ANFIS approaches. The results derived from the developed models show that the FIS + ANFIS models outperformed FIS + ANN model. The comparison of statistical values of 15 data sets for each model is shown in Table 4. This comparison is based on FIS model that had been verified for its effectiveness with the conventional models; stochastic EOQ model, Silver Meal model and Wagner Whitin model.

Table 4 The comparison of statistical values of 15 data sets for each model

The result of prediction performance showed that FIS + ANFIS_Trap model is outstanding, followed by FIS + AIS_Gauss model, FIS + ANFIS_Bell model and FIS + ANN model, respectively. For FIS + ANFIS models, the results of running times (epochs) showed that the lowest running time was FIS + ANFIS_Bell model, followed by FIS + ANFIS_Gauss model and FIS + ANFIS_Trap model, respectively. The training and checking curves of all proposed FIS + ANFIS models of data set 1 are shown in Fig. 13.

Fig. 13
figure 13

Training and checking curves of data set 1. a FIS + ANFIS_Trap model. b FIS + ANFIS_Gauss model. c FIS + ANFIS_Bell model

For implementation based on prediction performance, FIS + ANFIS_Trap model and FIS + ANFIS_Gauss model were suitable to use. However, based on running times, FIS + ANFIS_Bell model and FIS + ANFIS_Trap model were appropriate for the decision maker.

The results of each proposed model after entering the predicted values to the evaluation algorithm and calculating the total inventory costs is shown in Table 5. The ordering costs increased whereas the larger holding costs decreased for all models when compared with stochastic EOQ model.

Table 5 The total inventory cost of 15 data sets for each model

The average total inventory cost of all data sets and cost saving of all models compared to stochastic EOQ model is shown in Table 6. All models performed well with total inventory cost saving. The FIS + ANFIS_Gauss model achieved the largest cost saving by more than 75 % compared to stochastic EOQ model, followed by FIS + ANFIS_Bell model, FIS model, FIS + ANFIS_Trap model and FIS + ANN model, respectively. Although FIS + ANFIS_Trap model outperformed stochastic EOQ prediction when applied as the inventory model it represented the lowest cost saving, because some predicted values were affected by shortages which caused the shortage cost to be more than 30 % of total cost.

Table 6 The average total inventory cost of all data sets and cost saving of all models compared to stochastic EOQ model

Conclusion

Fuzzy Inventory System (FIS) model, FIS + ANN model and FIS + ANFIS models were proposed for solving a dynamic inventory lot-sizing problem with unpredictable conditions. Demand and supply were inputs and order quantity was output of the system. For FIS model, linguistic values were applied for both fuzzy inputs and outputs. Fuzzy rules were devised depending on the historical knowledge of a case study factory. Fifteen data sets originating from the distribution of the demand and supply of the case study factory were applied to evaluate the membership functions of the FIS model at different ranges of parameters. The appropriate ranges for the inputs of the FIS model were justified.

The output from FIS model was entered to the evaluation algorithm and calculated the total inventory cost. Then the output of FIS model was used as the input of the developed models, FIS + ANN model and FIS + ANFIS models. The FIS + ANFIS models were divided to 3 membership functions; trapezoidal and triangular, Gaussian and bell shape called the FIS + ANFIS_Trap model, FIS + ANFIS_Gauss model and FIS + ANFIS_Bell model, respectively.

The results from FIS + ANFIS models gave better values for prediction in terms of \(R^{2}\), RMSE and MAE. The predicted values showed good fit, but when output data was entered to the evaluation algorithm of inventory model, the best total inventory cost saving compared to stochastic EOQ model was achieved by the FIS + ANFIS_Gauss model. The research emphasized that application of FIS with ANFIS was beneficial for the inventory system and that FIS + ANFIS with Gaussian membership function achieved the best performance.

In further extended studies, the output of the model should be considered with fuzzy reorder point or fuzzy lead time, and the ANFIS model studied with linear output. The evaluation algorithm should also be adjusted according to the realistic situation in the future study.