T-S fuzzy systems optimization identification based on FCM and PSO

The division of fuzzy space is very important in the identification of premise parameters, and the Gaussian membership function is applied to the premise fuzzy set. However, the two parameters of Gaussian membership function, center and width, are not easy to be determined. In this paper, based on Fuzzy c-means (FCM) and particle swarm optimization (PSO) algorithm, a novel T-S fuzzy model optimal identification method of optimizing two parameters of Gaussian function is presented. Firstly, we use FCM algorithm to determine the Gaussian center for rough adjustment. Then, under the condition that the center of Gaussian function is fixed, the PSO algorithm is used to optimize another adjustable parameter, the width of the Gaussian membership function, to achieve fine-tuning, so as to complete the identification of prerequisite parameters of fuzzy model. In addition, the recursive least squares (RLS) algorithm is used to identify the conclusion parameters. Finally, the effectiveness of this method for T-S fuzzy model identification is verified by simulation examples, and the higher identification accuracy can be obtained by using the novel identification method described compared with other identification methods.


Introduction
In recent years, fuzzy model has been widely studied and has become an effective tool for complex system identification. The identification of fuzzy model consists of structure identification and parameter identification. The structure identification is divided into the identification of precursor structure and conclusion structure. Parameter identification is also divided into premise parameter identification and conclusion parameter identification. Takagi and Sugeno [1] has demonstrated that systems based on fuzzy rules can approximate highly nonlinear systems. T-S fuzzy model is widely used in nonlinear system modeling and model-based control [2][3][4]. There are many methods to realize premise parameter identification and fuzzy space partition, such as fuzzy c-means (FCM) [5][6][7], fuzzy c-regression model (FCRM) [8][9][10][11][12], Gath-Geva *Correspondence: lfc@ysu.edu.cn 1 Engineering Research Center of the Ministry of Education for Intelligent Control System and Intelligent Equipment, Yanshan University, Hebei Street, Qinhuangdao, 066004, China Full list of author information is available at the end of the article clustering algorithm [13], and Gustafson-Kessel clustering algorithm [14].
In order to improve the identification accuracy of the model and prepare for further control, this article starts with changing the method of dividing the fuzzy space to improve the identification accuracy of the fuzzy model. Various studies and related data show that FCM is very suitable and widely used to identify the premise parameters of T-S fuzzy model. The core problem of FCM clustering algorithm is to establish a reasonable clustering index to optimize the division of fuzzy input space. The FCM algorithm is mainly based on the Euclidean norm of data clustering center to form spherical clustering algorithm, which is obtained by optimizing the objective function of each sample points for all class center membership degree, and the category of the sample points in order to achieve the goal of automatic classifying sample data. Wang et al. [15] used the nearest neighbor clustering method to preset the initial parameters of fuzzy clustering to achieve the purpose of improving accuracy. The method proposed in the article is helpful to the accuracy improvement, but because there was no method to optimize the fuzzy space division, the accuracy improvement is not very large. Liu et al. [16] combined the improved PSO algorithm with FCM to improve the accuracy of model identification, but the article did not propose an improved method for the membership function. The literature [17] integrated the adaptive parameters of distance measurement into the FCM algorithm, which can flexibly control the depth of the relevant information between different attributes in medical data and improve the accuracy of the algorithm. However, the calculation method of the membership function in the article was not very accurate. High-order neural fuzzy c-means clustering algorithm was used to classify massive heterogeneous data in [18]. FCM clustering algorithm was used to quickly find out the central functions of two classes of clustering in the image domain in [19]. Mahalanobis and Minkowski metrics are used to replace the usual Euclidean distance in order to enhance the cluster detection capacity of FCM by allowing more accurate detection of arbitrary shapes of clusters for high dimensional datasets in [20]. A clustering method of kernel fuzzy c-regression model based on fuzzy correlation was proposed in [21], which solved the problem of identifying the presupposition parameters of T-S fuzzy model.
The division of fuzzy space has a great impact on improving the accuracy of fuzzy model identification. There are many methods for dividing fuzzy space, such as triangle function and bell-shaped Gaussian function. As a matter of fact, the bell-shaped Gaussian fits FCM because distance is also measured in a point-to-point fashion. How to combine the Gaussian membership function with the traditional FCM algorithm to improve the accuracy of model identification will be an interesting problem.
In order to identify the premise parameters more accurately and obtain higher identification accuracy, it is necessary to optimize the membership function parameters. FCRM method was used to optimize the center and width of Gaussian function to obtain higher modeling accuracy in [9]. Chandrakumar and Senthil [22] introduced a new fuzzy c-means objective function called kernel induced fuzzy c-means based on Gaussian function for the purpose of segmentation of medical images. The probability in the algorithm that indicates the spatial influence of the neighboring pixels on the center pixel plays a key role in this algorithm, and it obtains efficient method for calculating membership and updating prototypes by minimizing the new objective function of Gaussian based fuzzy c-means. An intuitionistic fuzzy neural network (IFNN) with Gaussian membership function and Yagergenerating function is proposed in [23], and the incorporation of the concept of IFL into a fuzzy neural network (FNN) can enhance the performance of an FNN. It can be seen that Gaussian function plays an important role in identification of modeling. This paper adopts a method to determine and adjust two key parameters of Gaussian function (center and width). The method adopted in this paper is to determine the center of Gaussian function by using the FCM algorithm, and to optimize its width by using PSO algorithm when the center has been determined and remains unchanged, so as to complete the fuzzy division of the premise parameters of the fuzzy model. In addition, the corresponding parameters are determined by RLS method. The novelty of our paper are expressed in the following aspects: (1) For the first time, FCM clustering algorithm is combined with Gaussian function for fuzzy model identification.
(2) The creative introduction of PSO algorithm achieves fine-tuning, making the fuzzy model identification more accurate.
The rest part of this paper is organized as follows. Section 2 gives a brief and basic introduction to the T-S (2020) 2020:47 Page 3 of 15 fuzzy model. In Section 3, we come up with a new fuzzy system identification method and describe the fuzzy modeling method. In Section 4, the validity of the proposed method is verified by three experiments, and its superiority is proved by comparing with other methods. Section 5 is the conclusion.

T-S fuzzy model
T-S model is a rule-based model in which the preconditions of rules are fuzzy variables and the conclusion is a linear function of input and output. It is based on local linearity and achieves global nonlinearity through fuzzy reasoning. T-S model is generally defined as: . . + p i n x n ; where R i is the ith fuzzy rule, i = 1, 2, . . . , c; c is the number of fuzzy rule; A ij is the ith fuzzy subset of variable x j ; x is the input variable, x = [1, x 1 , x 2 , . . . , x n ] T ; y i is the output variable of ith fuzzy rule; and p l i is the consequent parameters, l = 0, 1, . . . , n.
Each fuzzy rule has a matching degree, which represents the contribution of ith rule to the total T-S fuzzy model: Some forms of membership functions (triangle, trapezoid, and bell) can be applied to the presupposition fuzzy set. The bell-shaped fuzzy set A ik is used in this paper: c ij and b ij are the parameters of Gaussian membership function. The output of T-S model is a weighted average of individual rules: where ω i = τ i / c j=1 τ j is the validity function of ith rule, y i is the output of ith submodel, and . . , c is the conclusion parameter of ith rule.

The proposed T-S fuzzy model identification approach
In present section, we will introduce a novel prerequisite parameter identification method of T-S fuzzy model in detail. Firstly, FCM algorithm is used to initialize inputoutput space, decompose input space into c fuzzy subspace, and determine the clustering center of fuzzy subspace. After that, the center of the fuzzy subspace which is gotten in the first step is substituted into the Gaussian membership function. In the third step, the PSO algorithm is utilized to optimize the width of the Gaussian function and determine the membership function while keeping the center of the Gaussian function unchanged. The center and width of the Gaussian function are not easy to be determine. Finally, RLS method is used to identify the conclusion parameters. Then, the identification model is obtained and the specific flow diagram of this method is shown in Fig. 1.
The key problem of the new modeling method proposed in this paper lies in the application of Gaussian membership function and how to quickly optimize its two parameters, center and width. These are discussed in detail in this section.

A novel premise parameter identification method is based on FCM and PSO
In this part, we will elaborate the method of using traditional FCM clustering algorithm and PSO algorithm to determine the parameters of Gaussian function. FCM algorithm is used to obtain rough tuning results, and then, PSO algorithm is used to achieve fine-tuning. The used methods of minute forming fuzzy set are all conventional algorithms, which are characterized by simple structure and helpful to make the identification of premise parameters more concise and effective.

Determination of center of Gaussian membership function by FCM
The FCM algorithm [10] can be expressed as minimizing the following objective function: where n is the input variable dimension and c is the cluster center number. m > 1 is weight index of membership function. If m is too small, the membership of the input variable is around 1, which will affect the identification accuracy; if m is too large, the number of crossover among membership functions is too much, which will also affect the identification accuracy. In practice, m = 2 is often taken. U is a fuzzy partition matrix containing the membership of each feature vector for each cluster. z is the center of clustering, z = {z 1 , z 2 , . . . , z c }, z i ∈ R n . The clustering center can be calculated according to formula (6): The fuzzy membership function matrix U can be obtained by the following formulas: The initial value of the FCM center matrix z is given at random; after that, the fuzzy partition matrix U is calculated by using formula (7) for all the eigenvectors. The initialization of z is obtained by randomly selecting the eigenvalues of each cluster center z ij , which should be within the set of the listed eigendata. The stop condition is achieved by setting ε. Set it according to users' needs.
Offline calculation method is as follows: (1) Random number generator is used to give the initial value to the clustering center matrix z, and the clustering center was recorded, and set k = 0; (2) The initial value of the fuzzy partition matrix U (k=0) is calculated by using Eqs. (7) and (8); (3) Increase k so that k = k + 1, and use Eq. (6) to update cluster center z; (4) Equations (7) and (8) are used to renew the fuzzy partition matrix U (k) ; The center of Gaussian function (the clustering center) can be obtained from the above steps.

Optimization of the width of Gaussian membership function by PSO
In 1995, Kennedy et al. proposed PSO algorithm [24], which has the advantages of evolutionary computation and swarm intelligence, and it is a heuristic global optimization algorithm. In this paper, the purpose of using PSO is to optimize the width of Gaussian function and realize the fine-tuning of fuzzy division of premise parameters to get higher modeling accuracy. In addition, when optimizing the width parameter, the minimum mean square error (MSE) (formula (18)) is used as the objective function of PSO algorithm for global search to find the best particle location. The PSO algorithm is briefly described as follows: let particles search in D-dimensional space, and the number of particles is N. Where the position of kth particle  the optimization problem, and the particle finds a new solution by constantly changing its position and speed. The optimal solution of the kth particle searched so far is P k = (p k1 , p k2 , . . . , p kD ), and the optimal position experienced by the whole group is P g = (p g1 , p g2 , . . . , p gD ). The velocity and position of each particle vary in line with Eqs. (9) and (10): where r 1 and r 2 are the random numbers between [0,1]; c 1 and c 2 are the normal numbers, which are called accelerators; and w is the inertia weight. The range of velocity and position variation in d-dimension of each particle is −v d,max , v d,max and −x d,max , x d,max . If the maximum velocity of the particle, v d,max , is too high, it might cause the particle to fly through the best solution; if the maximum velocity is too small to make the search speed too slow, it may lead to fall into local optimal solution. Inertia weight w can well control the search range of particles. When w is large, particles are searched in a wide range.
When w is small, particles are excavated in a small range. When PSO algorithm is used to optimize the width of Gaussian function, the learning factors c 1 , c 2 are both set as 2 and the inertia weight ω is updated by the following formula: where DT is the number of iterations. Let maxDT = 100 be the maximum number of iterations, and ω min = 0.4, ω max = 0.9. According to the above methods, the optimal widths of Gaussian membership function are obtained. The new premise parameter identification method can be specifically described as: 1) Determine the number of input variables r, and make a fuzzy division of each input space (determine c). Initialize the center and width of the Gaussian.
2) FCM algorithm is used to optimize the centers of Gaussian function and determine the centers of Gaussian function. The center of Gaussian function is determined by FCM algorithm. Firstly, the FCM algorithm is used to automatically obtain the initial  function, and a relatively ideal membership function is finally obtained.

Consequent parameter identification
The identification of the premise parameters is determined, followed by the identification of the consequent parameters.
The output of the system can be expressed as: where x k is the kth input variable of the fuzzy model; μ A jk is the membership of the jth fuzzy subset of variable x k , which is obtained by the previous fuzzy partition; y i is the output of rule i; and is a fuzzy operator, usually using small operation. Define so the output of the fuzzy system is: substitute N pairs of input and output data into (14) to get a matrix equation.
where P is the L = (r + 1)c-dimensional consequent parameter vector and Y and X are the matrices of N × 1 and N × L. r is the number of input variables, and c is the fuzzy rule number. P * = X T X −1 X T Y is the least square estimation of P. In order to iteratively optimize the consequent parameter matrix P and avoid matrix inverse, the recursive least squares algorithm is adopted here. If the ith row vector of X is x i and the ith component of Y is y i , then the recursive algorithm is: Initial condition is P 0 = 0, S 0 = αI. α is always going to be more than 10,000. I is the identity matrix of L×L. Formula (16) is used to calculate the optimal conclusion parameters in the sense of error square, and output the conclusion parameters and the minimum mean square error MSE after the recursive termination.
The complete fuzzy identification algorithm proposed in this paper is as follows:  (1) Determine the number of input variables r, and conduct fuzzy division of each input space (determine c); (2) Calculate the premise parameters μ A ij (x j ) according to Eq. (2) of this paper; (3) Get X from Eq. (14); (4) P is obtained by using Eqs. (16) and (17); (5) Calculate the performance indicator MSE. If the value is less than the threshold or two adjacent times are unchanged, then go to step 6. Otherwise, go to step 4; (6) If MSE satisfies the required recognition accuracy, the identification is terminated; if not, add c and go to step 2.

Simulation experiment and application
In this paper, two well-known simulation examples and a practical application system are cited to confirm that the performance of the proposed identification method is superior to some previous methods, which mainly includes the prediction performance and generalization of the model. In the simulation example, through comparison with other methods in the literature, such as the traditional FCM algorithm [9], FCRM algorithm [10], and some other improved FCM algorithms [12], the prediction performance of the model in simulation examples is verified. In order to verify the generalization of the model, the data sample set is divided into two parts: training and testing. The training data is used to build the fuzzy model, and the testing data is used to check the generalization of the model.

A nonlinear difference equation
In this section, the nonlinear difference equation proposed by Narendra and Parthasarathy [25] is taken as the simulation object, whose expression is formula (20): This experiment uses cross-validation to test the predictive performance of the proposed method. The random number between [ −2, 2] is taken as the input signal u(k) of the training data and is substituted into formula (20) to obtain 500 training data. Then, we change the input signal to u(k) = sin(2k/25) and plug it into the formula to get 500 sets of test data. The training data and test data are demonstrated in Fig. 2.
In this model, u(k), y(k−1), y(k−2) are selected as input data and y(k) as output data for modeling. The number of fuzzy rules is set as 4. After the first phase of modeling is completed, the test data-driven model is used to test the  Table 1 indicates the results of the center and width of the Gaussian function before and after optimization, and Fig. 3 shows the change of membership function from initial optimization center to further optimization width under the 4 rules represented by variable u(k) in this case. The comparison diagram of model output and error obtained after the simulation experiment is shown in Fig. 4. At the same time, the mean square error of modeling and testing of the fuzzy model and the real model is also obtained, and the detailed values and comparison are shown in Table 2.

Box-Jenkins system
The famous gas furnace data such as the Box-Jenkins dataset (Box and Jenkins [30]) have been used by many scholars as standard experimental data to test identifica-tion methods. The input u(k) is the flow to the gas stove, and the output y(k) is the concentration of carbon dioxide at the outlet. The Box-Jenkins system is a SISO dynamic system, which has 296 pairs of input-output measurements. Here, u(k), u(k − 1), u(k − 2), y(k − 1), y(k − 2), y(k − 3) are chosen as input variables and y(k) is chosen as output, which are conducted simulation experiment. In order to verify the effectiveness of the algorithm, this experiment is set as two cases. In case 1, all 296 sets of data are used to build the model; in case 2, the data is divided into two groups, one of which is used as training data to establish a fuzzy model, and the other set of data is used as test data to test the prediction performance. When all the data is used for modeling, the fuzzy rule number c is set as 4, and the fuzzy rule number c is set as 3 in case 2.  Tables 3 and 4 respectively exhibit the centers and widths before and after the membership function optimization of this experiment case 1, and the change of membership function from optimization center to further optimization width under the 4 rules represented by variable u(k) is shown in Fig. 5. Figure 6 shows the performance of the fuzzy model identified in case 1, where Fig. 6a visually exhibits the original output and model output, and Fig. 6b demonstrates the error between model output and predicted output of each data point. The model performance evaluation index MSE of case 1 is 0.0428, and the comparison results with other methods are exhibited in Table 5. It can be seen from the performance comparisons shown in Table 3 that the method we proposed has great advantages in modeling. The fuzzy rules of the fuzzy system obtained in this case are shown as follows: 16 Then 26 Then  Tables 6 and 7 respectively demonstrate the center and width before and after the membership function optimization of this experiment case 2. The change of membership function is shown in Fig. 7. Figure 8 exhibits the fuzzy model performance of case 2, where a and b are the fuzzy modeling output of the training data and the modeling error of each data point, and c and d are the fuzzy model performance reflected in the prediction data. The modeling evaluation index of case 2 is 0.0123, and the prediction evaluation index is 0.168. The detailed comparison is shown in Table 8. In this case, although the prediction accuracy of the model is improved, it is not obvious. However, to some extent, it also proves the effectiveness of the algorithm in prediction.

The variable load pneumatic loading system
The variable load pneumatic loading system has the advantages of low cost, high output/mass ratio, no pollution, convenient maintenance, and so on, which is widely used in the field of industrial automation [33,34]. Because of the complexity of gas flow, the compressibility of gas, the nonlinearity of valve, the friction characteristics of cylinder, and the vulnerability of system parameters to environment, the modeling and control of pneumatic loading system have become a very challenging work.
Generally speaking, there are two ways to establish the system model: one is that the operation law of the system is completely known and the model is built according to the physical law; the another one is to identify the system model from the operation and experimental data of the system. In this paper, data-driven fuzzy modeling method is used to build the model of the variable load pneumatic loading system. Figure 9 is the structure diagram of the pneumatic loading system for test. The system includes stabilized pressure air source, pneumatic couplet, SMC ITV2050 pilot electric proportional pressure valve, SMC CDQ2A50 single rod double acting cylinder with cylinder diameter of 40 mm and stroke of 50 mm, and other pneumatic components. The measurement and control system includes MCL-L pull pressure sensor for real-time pressure measurement, Advantech PCI1710 data acquisition card for analog input, and Advantech PCI17 20 for control output.
The system controller is IPC-610H industrial computer.
In this paper, in the dynamic range of the system, the pseudo-random sequence is used as the excitation signal, which continuously acts on the system in the open-loop state and collects the input and output data of the system. The sampling period is 0.1 s, the sampling time is 100 s, and 1000 sample points u(k), y(k) are obtained, of which the first 800 data were used as training data and the rest were predicted data. The following variables u(k), u(k − 1), u(k − 2), y(k − 1), y(k − 2), and y(k − 3) are selected as the candidate input variables of the model, and y(k) as the output variable. The number of fuzzy rules is set as 3. Figure 10 shows the offline modeling process curve of the variable load pneumatic loading system based on the method proposed in this paper, where Fig. 10a shows the outputs of the fuzzy model comparing with that of the real system, and Fig. 10b shows the errors between the system outputs and the model outputs. Figure 10c and d show the output and error of the predicted data. If 6 variables above are all selected as inputs, the training MSE of the our model is 0.6982 and the testing MSE is 18.1004. Table 9 shows the comparison between the traditional identification method (Gaussian function based on bisection method and optimizing the center of Gaussian function using FCM) and the method presented in this paper.
The experimental results show that the algorithm proposed in this paper can effectively reduce the influence of time delay on the system, more effectively control the variable load pneumatic loading system, and achieve the rapid response and accurate tracking of the system, and has good adaptive ability.

Results and discussion
In order to improve the accuracy and efficiency of model recognition, a novel method of prerequisite structure recognition is proposed in this paper. On the condition of not using complex structure and algorithm, FCM algorithm, which is commonly used in fuzzy space partition, is selected to complete the coarse-tuning of the algorithm. In order to further complete fine-tuning, we choose PSO optimization algorithm. After two steps of adjustment, the Gaussian fuzzy set can be obtained, and the identification of the premise parameters can be completed. At the same time, the RLS method is used to identify the conclusion parameters and complete the identification of the fuzzy model. In this paper, the robustness and predictive performance of the proposed algorithm are verified by two international standard examples and an actual system application. In order to highlight the advantages of this algorithm, the modeling accuracy is compared with other methods in literatures, which fully verifies that this method has obvious advantages in improving the modeling accuracy. With the continuous development and maturity of intelligent optimization algorithms, more and more excellent optimization algorithms have emerged, such as hybrid frog leaping algorithm, firefly algorithm, and cockroach algorithm. For a specific fuzzy identification problem, it is a more practical research direction to the appropriate intelligent optimization algorithm which is used for parameter identification, to explore a fuzzy identification method with faster convergence speed and higher accuracy, and to better and more successfully apply it to the actual fuzzy system identification.