1 Introduction

Fuzzy cognitive map (FCM) [1, 2] is a graph-like inference mechanism based on fuzzy logic and recurrent neural network methodologies. It consists of nodes (states or concepts) and edges (causal links or events), which concepts influence each other depending on weights of events. FCM is capable of modeling complex decision problems via semantic definition of concepts and events, and then concurrent analysis of the concepts of the given problem. There are basically two FCM-based computational methods: definition and incremental formulas [3]. An expert defines fuzzy weights of both concepts and events of a given problem, and then runs the respective FCM for decision results. FCM also supports group decision making, i.e., by aggregating multiple decision makers’ views on a specific problem [4], as well as supervisory control [5].

Usually, decision making involves N in factor concepts (inputs) and N out decision concepts (outputs). However, there are situations where inputs and outputs overlap or exchange role. A set of events (events matrix) existing among concepts plays the key role in inference, deriving outputs from inputs. FCMs can be trained to learn more about problems in hand. There are many approaches to train FCMs mostly by tuning their event matrices including genetic algorithms (GA) [68] and Hebbian algorithms [911]. However, regardless of the employed training technique, still their inference is either based on definition or incremental formula as investigated in this paper.

2 Background

In the definition formula (Eq. 1), the new weight of each concept c j at cycle (k + 1) is defined from squashing the total effect of all concepts (c 1,…,c n ) on c j into a standard range of (0, 1) using a logistic function symmetrically around 0.5 (sigmoid curve). Other threshold functions such as tan h can be used too [5]. The total effect is in fact a sum of multiplications of each concept’s weight (c i ) from the preceding cycle (k) by the weight of the respective causal link (event e i,j ) that connects c i to c j [3].

$$ c_{j}^{(k + 1)} = \left( {1 + e^{{ - \sum\nolimits_{i = 1}^{n} {c_{i}^{(k)} e_{i,j} } }} } \right)^{ - 1} \,{\text{and}}\,j \in \left\{ {1 ,\ldots ,n} \right\} $$
(1)

This method is disadvantageous since concepts’ weights are entirely defined anew during each cycle. In other words, a concept’s new value is not directly influenced by its own value from the previous cycle because such term is not included in the inference formula (Eq. 1). Although each concept weight from last cycle affects all new ones through the causal links, its effect on itself is usually dissolved in others’ effects on it. Moreover, the effects of the events’ weights far outweigh those of the previous concepts’ weights. This is shown in Fig. 1 through a 3-concept FCM example. While the initial weights are different in the two trials in the left and right graphs, with the same events matrix, the results are similar after several cycles (with convergence precision of ε = 0.001). The definition method is regarded as the basic type of FCM-based reasoning [1, 2], however, there are still recent techniques on the basis of this method, e.g., [7, 8].

Fig. 1
figure 1

Different sets of initial weights for A, B, C in the two graphs have converged to same amounts: 0.447, 0.630, 0.296 using a random events matrix: {e A,A, e A,B, e A,C; e B,Ae C,C} = {0.1, 0.9, −0.7; −0.6, 0.3, −0.5; 0.4, −0.2, −0.8}

The incremental method is meant to increase influence of concepts on their own weights and is therefore more realistic in terms of decision outputs. Its only difference is in adding squashed value of each concept from previous cycle to a fraction of total effect on it during current cycle. This method is used in most FCMs (Eq. 2) [10], where 0 < α < 1 is the gain, and λ > 0 is the steepness of the sigmoid. But despite of the modifications compared to the definition model, the problem of lack of influence from initial weights still persists in the incremental model.

$$ c_{j}^{(k + 1)} = g\left( {c_{j}^{(k + 1)} + \alpha \sum\limits_{i = 1}^{n} {c_{i}^{(k)} \cdot e_{i,j} } } \right)\,{\text{and}}\,g_{(x)} = \left( {1 + e^{ - \lambda x} } \right)^{ - 1} $$
(2)

For example, with α = 1 and λ = 1 as in the method of [11], for a non-activated concept c j (total effect E t,j on c j is zero), by solving (2) for convergence, the steady-state c j would be always near 0.659 regardless of its initial amount (Eq. 3). The same happens to activated concepts which receive influence from others. For example, a steady-state E t,j merely changes (3) to (4), which also gives a constant output for c j at convergence regardless of initial weight of c j . Therefore, FCM has the problem of lack of sensitivity to initial values of the concepts, i.e., a priori knowledge. It maintains same outputs for any given set of initial input weights. This consequently causes wrong interpretation of outputs or decision alternatives.

$$ y = \left( {1 + e^{ - y} } \right)^{ - 1} \quad {\text{where}}\;y = c_{j}^{(k + 1)} = c_{j}^{(k)} $$
(3)
$$ y = \left( {1 + e^{{ - (y + E_{t ,j} )}} } \right)^{ - 1} $$
(4)

The problem is illustrated using an incremental FCM with 5 concepts: A to E, and a 5 × 5 events matrix (Fig. 2). It is observed that the same outputs are generated upon convergence, while different sets of initial concepts’ weights have been defined. Another drawback is that concept E with the lowest initial value has gained a considerable output value without being activated (e A,E = e B,E = e C,E = e D,E = e E,E = 0). This misleads the intended decision-making process since E has incidentally obtained the second highest rank among all decision alternatives at output. Overall, although FCM’s events matrix should play the main role in inference, still the initial values of inputs must be taken into account and should influence output values in some way. This has been overlooked in previous FCM implementations. Here, it must be noted that the described methods are the standard FCM frameworks, in which, all concepts are activated simultaneously at each cycle (concurrently updated with new weights). Therefore, the concepts’ activation order is not important in contrast to the method of [9] where expert planner is also required to determine the sequence of activation of concepts, which results into different outputs.

Fig. 2
figure 2

Different initial set A to E in the two graphs resulted into same outputs with ε = 0.001 and random matrix: {e A,Ae A,E; e B,Ae E,E} = {0.43, −0.53, −0.72, 0.39, 0; −0.83, −0.91, −0.46, 0.24, 0; −0.29, −0.6, 0.15, −0.21, 0; −0.48, −0.87, 0.9, 0.6, 0; −0.2, −0.8, −0.71, −0.19, 0}

3 Proposed strategy

On the basis of the above algorithms, this paper presents an input-sensitive FCM-based inference. The proposed algorithm seemingly follows the formula of definition since the total effect is not added to the previous concept value. However, it encompasses the concept of incremental formula in a new way. Instead of normalizing weighs around a fixed value, e.g., sigmoid around 0.5, each concept’s weight (at cycle k + 1) is squashed about its previous weight (from cycle k) (Eq. 5) allowing for direct impact of initial weights on ultimate outputs, i.e., each weight determines the center of the respective logistic function along successive cycles. Therefore, a concept with a relatively high initial value shall converge to a high amount unless there is too much negative effect on it through causal links (event matrix). Reversely, concepts with lower values will converge to lower amounts unless they are positively influenced by others. This signifies improvement of FCM’s sensitivity to initial values of inputs.

$$ c_{j}^{(k + 1)} = f\left( {\sum\limits_{i = 1}^{n} {c_{i}^{(k)} \cdot e_{i,j} } } \right)\,{\text{and}}\,\,f_{(x)} = {\frac{{\gamma c_{j}^{(k)} e^{\lambda x} }}{{\gamma c_{j}^{(k)} \left( {e^{\lambda x} - 1} \right) + 1}}} $$
(5)
$$ \quad {\text{where}}\;j \in \{ 1, \ldots ,n\} ,\;0 < \gamma < 1 $$

This method also eliminates the adverse effect of non-activated concepts on inference that is a major improvement. A non-activated concept, whose value is neither increased nor decreased by others, shall remain the same or gradually become neutral throughout the inference process. However, the previous models have overlooked this issue and sometimes a non-activated concept gets increased and adversely affects the inference process for itself and other concepts’ values.

In the developed model, however, while positive or negative effects on a concept c j makes its amount approach 1 or 0, respectively, a neutral effect (E t,j  = 0) makes the concept’s weight approach γc (k) j at cycle (k + 1). By choosing 0 < γ < 1, the weight should always decrease in case of receiving neural effect. The variable γ requires delicate expert analysis for best results. However, the setup analysis is qualitatively equal to the incremental model due to elimination of the gain α in the new method (variables α and λ have been merged).

4 Results and discussion

The experiments show that direct influence of the initial weights (at cycle 0) on the results (at convergence cycle) has been achieved by continually squashing new weights (at cycle k + 1) around previous weights (at cycle k). In other words, the new weights always follow the previous ones with smooth deviations, which will lead to convergence upon completion of the inference. Therefore, there is a direct effect from inputs on results due to dependency of weights at cycle k + 1 on those at cycle k.

To analyze the method, a 10-concept FCM with a random 10 × 10 events matrix is created in which the effect of all concepts on a single concept ‘I’ is kept zero. While in Fig. 3 (incremental model), two different input sets have converged to same outputs, the same input sets have resulted into different outputs in Fig. 4 (the developed input-sensitive model). This allows for realistic FCM-based problem solving as the outputs are not only influenced by the event matrix but also by the initial settings of the problem’s concepts. The concepts variations over cycles are smoother in the input-sensitive FCM due to their dependency on their previous amounts. But, such dependency level leads to more number of cycles (Fig. 4) for obtaining the same precision of convergence.

Fig. 3
figure 3

Different sets of initial weights in the two graphs (using incremental model with α = 1, λ = 1, ε = 0.001) result into same outputs upon different inputs. The matrix {e A,Ae J,J} for Figs. 3 and 4 is given in Appendix. a Initial A to J: 0.91, 0.82, 0.73, 0.64, 0.55, 0.46, 0.37, 0.28, 0.19, 0.10. b Initial A to J: 0.10, 0.19, 0.28, 0.37, 0.46, 0.55, 0.64, 0.73, 0.82, 0.91

Fig. 4
figure 4

The new model (λ = 1, γ = 0.9, ε = 0.001) results into partly different outputs upon different initial inputs. a Initial weights A to J: 0.91, 0.82, 0.73, 0.64, 0.55, 0.46, 0.37, 0.28, 0.19, 0.10. b Reversed initial weights A to J: 0.10, 0.19, 0.28, 0.37, 0.46, 0.55, 0.64, 0.73, 0.82, 0.91

Traditionally, the steepness of the logistic function (λ) is an option to speed up convergence where λ > 1 decreases number of cycles. Another option is to decrease the precision of convergence (ε) to allow obtaining outputs at earlier stage. However, both require more expert effort on tuning λ, and ε during FCM planning. Overall, since in most cases computational cost is not a problem, the developed algorithm preformed better than the incremental model, despite its need for more cycles. In addition, with the same runtime, the new model is advantageous over the definition and incremental methods in terms of sensitivity to initial weights of concepts.

Concept ‘I’ is not activated through the matrix of events (Appendix). However, the incremental model always converges ‘I’ to a higher weight (Fig. 3a), or lower weight (Fig. 3b) than its original weight, without activation. This problem is also resolved as shown in Fig. 4a and b where concept ‘I’ is converged to zero with both high and low initial weights. The zero effect of the events matrix has converged ‘I’ to zero signifying that the events matrix still plays the dominant role in the inference process. However, the initial values of the concepts are effective too indicating the fulfillment of the model’s objectives.

4.1 A case study

Quadruped walking in bio-inspired mobile robotics is defined as the problem of modeling 4-legged locomotion where each leg (limb) gets two states of support (during time of contact with the ground t c) or swing (recovery). As the four limbs alternatively switch between support and swing phases during every walk cycle or stride period T s, and by exerting repulsive force to the ground, the animal (or robot) is pushed forward due to the ground’s reaction force G; G is a sum of vertical, horizontal, and mediolateral forces \( \vec{G} = \vec{G}_{\text{v}} + \vec{G}_{\text{n}} + \vec{G}_{\text{m}} \) [12].

The vertical component serves to support the weight of the animal, while the other two cause changes in pace and direction. At rest, the animal’s weight W is supported by all limbs, thus, each limb approximately bears W/n where n is the number of limbs, e.g., n = 4 in quadrupeds. The exact distribution of weight depends on where the center of the mass is located. During walking and other gaits, however, the weight is distributed only on support limbs. Equation (6) shows the relationship between the weight and the vertical force G v on every leg as shown in Fig. 5. It must be noted that the graphs of Fig. 5c show the approximate steady-state ground force without including impact forces.

Fig. 5
figure 5

a A sample quadruped locomotion [14]. b The quadruped walking cycle [12]. c Ideal duty cycles of the four limbs. The limbs’ support (black circle) and swing (white circle) are used for encoding the locomotion. The jargon terms are defined: LH (Left Hind leg), RH (Right Hind leg), LF (Left Front leg), and RF (Right Front leg)

$$ {\frac{1}{{T_{\text{s}} }}}\int\limits_{0}^{{T_{\text{s}} }} {G_{\text{v}} {\text{d}}t = \frac{W}{n}} ,\quad n = 4 $$
(6)

Figure 5a is adapted from [13] to explain the locomotion of horse (phases A to H) for the example case of this study. A limb’s duty cycle β is defined as the ratio of the limb’s period of support or ground contact tc over the entire stride period T s (β = t c/T s). Duty cycle is critically related to the locomotor gait of the animal: β ≥ 0.5 (walking) and β < 0.5 (trotting and galloping). The phases A to H in Fig. 5a apparently show a fast walk. To provide a smaller size of the problem, β is increased to about 0.75 in Fig. 5b, which is known as the walking gait of the quadrupeds as fully discussed in [12]. It is also addressed by [13] that if the duty cycle is between 0.75 and 0.83, i.e., known as walking differentiated from trotting and cantering, only the sequence of LF, RH, RF, and LH as swing limbs leads to a stable four beat walking gait. Figure 5c shows the duty cycles where the limbs LF, RH, RF, and LH uninterruptedly switch to alternative support and swing phases.

FCM-based modeling involves definition of concepts: concept names and their initial values, as well as definition of the event matrix. Accordingly, for modeling, the described system, a 4-concept FCM is formed where LF, RH, RF, and LH are the names of the four concepts (Fig. 6a). The membership functions in Fig. 5c are used to determine the initial values of the FCM concepts as a priori knowledge before running FCM at decision points. The concept’s range is within (0, 1) where 1 means the limb is fully supporting W/3 and 0 means the limb is fully at swing. The FCM outputs are the decisions for altering limbs status. Four FCMs must be run for four successive decisions for transition from status A → C, C → E, E → G, G → A. Here, the FCM’s event matrix is expert-defined according to two apparent rules: (1) when a limb is going to support the weight, another limb can go for recovery, and, (2) when a limb is going for recovery (swing), another limb should support the weight.

Fig. 6
figure 6

a The developed FCM. b The summary of the input membership function, and the obtained decision outputs. cf The variations of the concepts until convergence (λ = 1, γ = 0.99, ε = 0.01)

For example, based on rule 1, the amount of the concept LF (G v on LF leg (G LFv ) has a negative effect (e LF,RH = −1) on RH (G RHv ), since the increase in the former causes the decrease in the latter. On the other hand, based on rule 2, when RH goes for recovery, G LFv increases. This implicitly means that G RHv has had an unknown negative effect (e.g., e RH,LF = −0.5) G LFv on as its absence lets G LFv to increase. It must be noted that the definition of the event matrix should be also through a membership function and with respect to many other factors such as the impact forces, displacement of center of gravity, friction characteristics. However, for the sake of brevity, this case study is limited to the most important factor that is the sequence of the swing and support phases as incorporated into the event matrix.

Figure 6a depicts the designed FCM, while Fig. 6c to f show the decision outputs of the four successive FCMs for altering limbs status from A → C, C → E, E → G, and G → A. As summarized in Fig. 6b, different sets of inputs have resulted to different outputs signifying the main advantage of the new model compared to the traditional models. For example, Fig. 7 shows that the incremental model (under exactly the same conditions) fails to generate distinct decisions as every time all concepts converge to 0.45 regardless of their initial values (Fig. 7a–d). Using the new model, however, four distinctive decision outputs have been obtained from the four different input statuses to simulate the walking cycle.

Fig. 7
figure 7

The FCM of Fig. 6a could not be solved using incremental formula with inputs {LF, RH, RF, LH} = {0,1,1,1} (a), {1,0,1,1} (b), {1,1,0,1} (c), {1,1,1,0} (d). The results are not distinctive and therefore not interpretable

For instance, in Fig. 6c, the current status of FCM (status A) is {LF, RH, RF, LH} = {0, 1, 1, 1}, which is set as the FCM input (initial concepts’ weights). Upon running the map and convergence (with ε = 0.01), the concept RH gets the highest weight. Therefore, the decision output is to let RH experience a recovery through a swing phase at status C which is what the animal dose in reality. Similarly, the other decision outputs mimic the natural phenomenon of quadruped walking in a fast and robust manner. It must be noted that, although the event matrix, i.e., based on the functions of Fig. 5c, has played the main role in inference, still the initial concepts’ weights have influenced the outputs uniquely indicating the effectiveness of the developed FCM strategy.

5 Conclusion

FCM is a powerful method of causal inference for analyzing and solving problems with numerous interrelated factors. In this paper, the fundamental FCM platforms were investigated. Having achieved sensitivity to initial weights of concepts through the development of a new inference strategy, as the future work, a solution must be sought to speed up the inference process, other than by tuning λ and ε that requires excessive expert work during FCM planning. This paper also examined a model of 4-legged locomotion of animals, which showed potential capabilities of the developed inference model. The system could be further developed to work on a quadruped robot for control of walking gait, etc., according to animal behavior. This objective requires further analysis of animal locomotion, related static and dynamic features, and bio-inspired robotics systems.