Prediction of Sunspots using Fuzzy Logic: A Triangular Membership Function-based Fuzzy C-Means Approach

Fuzzy logic is an algorithm that works on “degree of truth”, instead of the conventional crisp logic where the possible answer can be 1 or 0. Fuzzy logic resembles human thinking as it considers all the possible outcomes between 1 and 0 and it tries to reflect reality. Generation of membership functions is the key factor of fuzzy logic. An approach for generating fuzzy gaussian and triangular membership function using fuzzy cmeans is considered in this research. The problem related to sunspot prediction is considered and its accuracy is calculated. It is evident from the results that the proposed technique of generating membership functions using fuzzy c-means can be adopted for predicting sunspots. Keywords—Fuzzy logics; fuzzy c-means (FCM); Gaussian membership function; prediction; sunspots; triangular membership function


I. INTRODUCTION
For humans, many tasks are straightforward, like carrying delicate items, passing through crowds or parking a car. Whereas, these tasks can be challenging for computers or machines. Such tasks are made easy and simple for us due to our ability to deal with ambiguous and imprecise data. Therefore, in order to replicate this human operator's control behavior, we must model our systems in a way that make it capable of handling ambiguous and imprecise knowledge. This is exactly what fuzzy logic system do [1], it succeeds where system is overly challenging and complicated. Fuzzy logic has been effectively used in numerous applications from speech [2] and script [3] recognitions to control systems like speed control of Non-Silent Permanent Magnet Synchronous Motors [4].
The word fuzzy applies to details that are ambiguous and not obvious. [5] We sometimes face a condition in real world where we cannot decide if the state is falsifiable, there fuzzy logic offers a very precious reasoning versatility. In this manner, we can identify ambiguities and impreciseness of any scenarios. 1 and o depicts complete truth and false values in Boolean systems. Whereas, there is not completely true or false logic in fuzzy logics. However, in fuzzy logic there are so much of alternating values that are partly true and partly false [6].
One of the most important elements of fuzzy logic system (FLS) is membership function. A membership function is considered as a curve that maps each point value of input space to a membership degree. Input space consist of all the possible elements of consideration in each application, that is also known as the universal set (U) or discourse of universe. Selection of membership function is very critical in fuzzy logic as the entire fuzzy inference system (FIS) depends on the type of membership function used. There are various types of membership function but the most widely used ones are Gaussian, Triangular and Trapezoidal Membership Functions. Hence the generation of membership functions play a vital role in fuzzy logic system.
Few methods are proposed in [7] and [8] to generate single type of membership function. Whereas generation of multiple membership function provides a powerful toolbox for users to solve the problems in more effective ways [9]. Generation of multiple membership function using Complementary-Metal-Oxide-Semiconductor (C.M.O.S) is proposed in [9], which focus on using electric-current for generating membership functions. Based on the knowledge of the author, the literature has not yet recorded ways of generating multiple membership functions by fuzzy c-mean or data driven approach. Therefore, an approach is proposed in this research for generating multiple type of membership functions.
In this paper, we critically analyzed the proposed methods and algorithms in the generation of triangular and gaussian membership functions using fuzzy c-means. The contribution of this paper are as follow: (1) providing practitioners and researchers with insight and future direction on membership function generation through fuzzy c-means, (2) in terms of membership function generation, we investigate the approach of membership function generation using fuzzy c-means.
The remaining paper is arranged is following manner: background of crisp and fuzzy set as well as different current approaches to generate membership function is explained in Section 2, proposed approach and methodology are presented in Section 3. Whereas, Section 4 presents experiment and simulation results and Section 5 present future direction of research and its conclusion.

A. Crisp Set
Crisp sets are the basis of classical logic, in which a series of different entities known as a collection. As an example, if we consider colours like blue and black, they are both www.ijacsa.thesai.org different entities considering their characteristic but can be considered as a collection by following the notation {black, blue}. Capital letters are usually used to represent crisp sets, so the earlier example can be represented as: A crisp subset could be determined from a comprehensive set that contains the values of subset based on certain conditions. Let suppose as an example, we have a set X, such that it contains the integers that are less than 10 and greater than or equal to 2. This set can be represented by the following notation: X = {a | a is a whole number and 2 ≤ a ≤ 10} The subset represented above can be presented in graphical form if a characteristic notation or indicator function is introduced, which in above case is the operation described over the set of whole numbers, that can be represented as A, which shows the membership of values in subset X of A. To attain this, we call the elements of A in X as 1 and others as 0. Hence, the deduced indicator function can be: It can be illustrated as in Fig. 1.

B. Fuzzy Set and System
In 1965 Lofti Zadeh presented the concept of fuzzy sets, which led to the foundation of fuzzy logics and system [10]. In fuzzy logic theory, a fuzzy set is a set that ensures partial membership of a set. which can be determined by the degree of membership (µ) [11], which represent all the values between 1(a value fully belong to set) and 0 (a value totally not belong to set). It's obvious that if we eliminate all the belonging values except for 1 and 0, fuzzy set will be converted and act as a crisp that which was defined earlier.
The membership functions (MF) of a set is a link between the components of set and their belong to degree [12]. Fig. 2 shows the graphical representation of fuzzy membership function over temperature representation.  Fuzzy system for the temperature is illustrated in Fig. 2 that depicts how a human feel the temperature in real life that can be divided into sub-categories as "very hot", "hot", "mild", "cold" and "very cold", where as if we consider conventional crisp or Boolean logic we have only two possibilities that are hot or cold. Here we can see that at 40 degree of temperature, the system could be defined as being cold to a factor of 0.4 and mild to a factor of 0.6.

C. Fuzzy Inference System
A fuzzy framework is a pool of fuzzy expert intelligence and knowledge base that rather than the conventional and definite Boolean logic, can trigger data in vague terms. Expert knowledge is a combination of both fuzzy membership functions (MF) and fuzzy rule-base that contains all the fuzzy rules and are of form: If (conditions are true or fulfilled) Then (consequences are inferred) [1].
The basic architecture of fuzzy system is presented in Fig. 3.
A fuzzy system consists of 4 main components, namely a fuzzifier, an inference engine, fuzzy knowledge base and a defuzzifier.

1) Fuzzification:
Fuzzification is the prime step of fuzzy system where a crisp input is converted to fuzzy input [13] and is assigned a membership degree. The effective working of fuzzy logic system depends on the efficiency of membership function generated in fuzzification process.  2) Fuzzy-Inference-Engine: It matches fuzzy input degree based on fuzzy rule and make decisions related to the application on rules to input field. The inference engine act as a mind of fuzzy system as it provides the decision-making logics of the system, it can be implied as an emulation of human thinking and decision making.
3) Knowledgebase: It contains IF-THEN statements and fuzzy rules that helps in decision making based on linguistic information.

4) Defuzzification:
It is the final stage of fuzzy system where a fuzzy set obtained by inference engine is converted to crisp output [1].

D. Fuzzy Membership Functions and its Types
Membership function can be described as a curve which determines how membership values between 1 and 0 are mapped to input space usually called universal set, that consist of all possible values of interest in an application [11]. There are 3 major and widely used types of membership functions.

1) Fuzzy triangular membership function:
Fuzzy triangular MF can be described using {a, b, c} as: Another representation based on min and max is as follow: Here a < b < c represents the coordinates of triangular MF on x-axis. Graphical representation of triangular MF is presented in Fig. 4.

2) Fuzzy trapezoidal membership function:
Fuzzy trapezoidal MF can be described using {a, b, c, d} as: Another representation based on min and max is as follows: Here a < b < c < d) represents coordinates of trapezoidal MF on x-axis. Graphical representation of trapezoidal MF is presented in Fig. 5.

3) Fuzzy Gaussian membership function:
Fuzzy Gaussian MF can be described using ( ) as:  A cluster center c and width value σ are used to describe Gaussian MF. Graphical representation of Gaussian MF is presented in Fig. 6.   membership function is developed based on the parameters suggested by experts, whereas second method focuses on developing using machine learning approach like classification and clustering. As we know that in expert knowledge approach, parameters are directly provided by experts so that can be incomplete very biased as every expert can suggest different parameters based on their knowledge [14]. Apart from that, it can also be lacking accuracy and expert may have incomplete opinion or may not be available at all time. The method of data processing method will reduce some drawbacks of expert knowledge approach, if not eradicate them. We are therefore concentrating on the generation of fuzzy membership function automatically through data clustering approach in this study. b) FCM Algorithm: There are many types of clustering algorithms. Fuzzy C-means is one of the popular and essential clustering techniques based on fuzzy logic. The working of FCM is described below: Fuzzy C-means algorithm can work according to the steps mentioned below: 1) Fix cluster centers (c) i.e. (2 ≤ c ≤ n) and select value for parameter n.
3) Calculate cluster centers (fuzzy centers) for each step.
The flow chart for this process is presented in the Fig. 7: FCM Comparison with other Clustering Algorithms.
Apart from FCM some conventional or hard computing algorithms like K-means, Y-means, etc. are also available. Some advantages of FCM over other clustering algorithms are described below:  For overlapping dataset, FCM offers relatively better results than k-means.
 In FCM, every datapoint and cluster center is assigned, which results in the possession of multiple cluster centers on data points. Whereas, in K-means algorithm data point may only belong to single cluster center. [15].
 FCM can relatively converge more quicker as compare to K-means but that also increases the computational complexity of FCM. [15].
 In some cases or applications, FCM is more effective, robust and consistent in performance as compare to other clustering algorithms. [16].
 A comparison among Y-means, FCM and K-means is done which shows that FCM produces better results. [16].
 For intrusion detection, the key benefit of FCM is its high detection accuracy and low false positive rate. FCM is an effective approach but also time-consuming [16].

III. PROPOSED METHODOLOGY
The proposed approach of generating triangular membership function is depicted in Fig. 8 and is discussed below: To generate Gaussian and Triangular membership functions. A dataset is passed through fuzzifier where crisp inputs are converted to fuzzy inputs using FCM. Once data is passed through FCM, it gives fuzzy membership Matrix (Umatrix) and cluster center as an output. Gaussian membership function is than approximated using these values of membership matrix and cluster center. U-matrix and cluster centers are than passed through the formula sets where it converts it into the parameters needed for approximating triangular membership function. Once both gaussian and triangular membership functions are approximated they are than evaluated against test data sets to validate the outcome of an approach. The formula set for generating parameters of triangular membership function is presented below. a = α -β * γ; b = α; c = α + β * γ;  Here, a and c represent the floor whereas b represent the peak value of triangular membership function. α and γ are the values calculated from U-matrix and cluster centers while as β is constant.

IV. RESULTS AND DISCUSSION
To validate the approach, a prediction data set is used to predict monthly sunspot [17]. Sunspot dataset is used that calculate values of sunspot from 1749/01/01 to 2017/08/31 containing 2820 data values recorded on monthly basis. In the Sun's photosphere, sunspots are transient occurrences which appears as darker spots than the surrounding areas. These regions are of lowered surface temperature that happens due to convection-inhibiting magnetic flux concentrations. It normally occurs in pairs of opposite magnetic polarities. Their numbers vary as per the solar cycle that lasts around 11 years.
FIS is developed for Gaussian membership functions based on sunspots datasets and are presented in Fig. 9.
FIS is developed for Gaussian membership functions based on sunspots datasets and are presented in Fig. 10.
To evaluate the FIS, prediction test on sunspot is performed on sunspot dataset, whose results are shown in Fig. 11: It can be seen from the results shown in figure above that the prediction results are calculated for sunspot dataset for both Gaussian and triangular membership functions based on training and testing datasets. If we analyze the results, Gaussian membership function has the prediction accuracy of 99.46% whereas triangular membership function has an accuracy of 99.50%. It is evident that here Triangular membership function outperform Gaussian membership function and hence produce better results.   In this research, a technique is proposed to generate triangular and Gaussian fuzzy membership functions through fuzzy c-means. By analyzing the results, it can be concluded that the proposed approach of generating triangular and Gaussian membership functions using fuzzy c-means can be used for prediction of sunspots. This approach will be very effective in the field of data science and specially for prediction problems. It can have its application in many real world's data science problems such as classification, regression, and prediction. The approach will be applied to solve prediction problems such as to forecast electricity demand and price. In future we target to generate triangular as well as trapezoidal membership function using fuzzy type 2 and fuzzy interval type to systems.