{'fraction_non_alphanumeric': 0.028008618036318867, 'fraction_numerical': 0.006360931568687801, 'mean_word_length': 4.970903522205207, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Comparative Analysis of Firefly and Fuzzy- Firefly based Kernelized Hybrid C-Means Algorithms

In most of the clustering algorithms, the assignment of initial centroids is performed randomly, which affects both the final outcome and the number of iterations required. Another aspect of the approaches in clustering algorithms is the use of Euclidean distance as the measure of similarity between data points, which is handicapped by linear separability of input data. The purpose of this paper is to combine suitable techniques so that both the above problems can be handled suitably leading to efficient algorithms. For the initial assignment of centroids we use Firefly and Fuzzy Firefly algorithms. We replace the Euclidean distance by Kernels (Gaussian and Hyper-tangent) leading to hybridized versions. For experimental analysis we use five different images from different domains as input. Two efficiency measures; Davis Bouldin index (DB) and Dunn index (D) are used for comparison. The tabular values, their graphical representations and output images are generated to support the claims. The analysis proves the superiority of the optimized algorithms over their existing counterparts. We also find that Hyper-tangent kernel with Rough Intuitionistic Fuzzy C-Means algorithm using Fuzzy Firefly algorithm produces the best results and has a much faster convergence rate. The analysis of medical, satellite or geographical images can be done more efficiently using the proposed optimized algorithms. It is supposed to play an important role in image segmentation and analysis.


II. INTRODUCTION
Data clustering techniques are widely used in image segmentation over the past decade. Image segmentation involves the splitting and grouping of similar pixels of an image. With respect to position of elements in various clusters, clustering techniques can be categorized as: (a) Hard clustering and (b) Soft clustering. The data points in the case of hard clustering, can belong to at most one cluster i.e. they either belong to the cluster or not. In the case of soft or fuzzy clustering, the data points can belong to more than one clusters based on certain membership values. They use the Fuzzy Set concept [1]. Fuzzy C-Means (FCM) [2] is one of the simplest and most popular fuzzy clustering algorithm that uses the fuzzy set concept. Later, intuitionistic fuzzy sets [3] and rough sets were introduced [4]. Applying these models, several new clustering algorithms were developed such as Intuitionistic Fuzzy C-Means (IFCM) [5] that used the concept of intuitionistic fuzzy sets, Rough Fuzzy C-Means (RFCM) [6,7] that used the concept of rough fuzzy sets and, Rough Intuitionistic Fuzzy C-Means (RIFCM) [8], that used the concept of both, intuitionistic fuzzy sets and rough fuzzy sets.
In all these mentioned clustering algorithms, the Euclidean metric was used as a similarity measure. The Euclidean distance-based clustering algorithms have the problem of linearly separable datasets. However, this issue was corrected by using the kernel function. The kernel function projects the feature space into a higher dimension by applying an appropriate non-linear mapping function which ensures that the complex clusters are linearly separable which are otherwise not linearly separable in its original feature space. Thus, in an attempt to avail this generality several kernel function based algorithms have been developed [9]. Some of these algorithms are the Kernel based K-means clustering using rough sets [10], Kernel based rough fuzzy c-means algorithm [11], Kernel based Rough Intuitionistic Fuzzy C-Means algorithm [12]. A comparative analysis of uncertainty-based kernelized c-means algorithms has been provided in [13]. Fuzzy clustering algorithm for multidimensional data on ordinary scale [14] was proposed in 2017. All these algorithms involved random initialization of cluster centroids. This resulted in slow convergence and hence led to more computational cost.

III. RELATED WORK
In 2009, a metaheuristic inspired by the flashing behaviour of fireflies was proposed [15]. An improved version of this algorithm, namely, the Fuzzy Firefly algorithm was proposed by T. Hassanzadeh [16]. Stabilization of Rough Sets Based clustering algorithm using Firefly algorithm was proposed by Jain [17] where the firefly algorithm was used to assign the initial cluster centroids. Image Segmentation using Hybridized Firefly Algorithm and Intuitionistic Fuzzy C-Means was proposed by Chinta [18], where IFCM was combined with Firefly algorithm. In this paper, we make a comparative analysis of relative efficiencies of the hybrid algorithms obtained from basic FCM, IFCM, RFCM and RIFCM algorithm as well as their kernelized versions combined with two optimisation algorithms; firefly and fuzzy firefly for selection of initial centroids of clusters and make a comparative analysis of their performances. Two performance indices, Davis Bouldin index (DB) [19] and Dunn index (D) [20] has been used as efficiency measures of these algorithms. We have also established the relative relations between these algorithms. In section 2, we describe the various algorithms used in this analysis. In section 3 and 4, we discuss the methodology and analyze the results. The summary of our analysis is discussed in section 5 and section 6 contains the conclusion.

A. Clustering Algorithms
Clustering can be considered as the most important unsupervised learning problems. It is defined as the unsupervised classification of observations, data items, or feature vectors into groups (clusters) [21]. The following clustering algorithms have been used in this paper.

a. Fuzzy C-Means:
In Fuzzy C-Means, a data point may belong to multiple clusters. Each element has a membership value associated with it. This membership value is used to assign the data element to the clusters. The performance of clusters is measured by the objective functions The clusters are expected to be compact and thus should have minimum J value.
Here, value of m=2 ('m' is called the fuzzifier). 4. Calculate the cluster centroid as follows

b. Intuitionistic Fuzzy C-Means:
The Intuitionistic Fuzzy C-Means algorithm uses a new parameter known as ‗hesitation value' which improves the accuracy of the clustering.

Assign initial centers for 'c' clusters. 2. Calculate the distance d ik between the data points
x k and centroids v i using Euclidean function or some other appropriate distance measure. 3. Compute U (membership matrix) using (2) 4. Compute the hesitation matrix π as: ,

Compute the modified membership matrix using
11. Repeat steps 2 to 9 until the difference between two consecutive values of U is less than a preassigned value.

B. Optimization Algorithms:
a. Firefly Algorithm: Firefly Algorithm was proposed by Yang (2009) [15]. It is a bio-inspired meta-heuristic which mimics the behaviour of fireflies. Biologically, fireflies are attracted to luminous objects. In this algorithm, each firefly has its own brightness value and hence attracts all the other fireflies having lower brightness. The movement of the brightest firefly is random. The degree of attraction between two fireflies varies inversely to the distance between them. The brightness of a firefly is computed using an objective function which is problem-specific. The attractiveness (β) between two fireflies is determined by the formula: Here, 0  is the initial attractiveness value,  is the coefficient of light absorption and , ij  is the Euclidean distance between the two fireflies i and j. In the implementation of this algorithm, we take 0  =1 and  is in the range 0.01 to 100.
2 , The above equation is for the movement of firefly i to the brighter firefly j. α ϵ [0,1] denotes the randomization parameter. rand is a random number generator function uniformly distributed in the range [0,1]. This ensures that the fireflies are not stuck at a local optimum. Assign ranks to the fireflies and find the current best until either maximum iteration limit is reached or minimum change of the objective function occurs.
The most important characteristic of Firefly algorithm is its ability to avoid the local optima as fireflies covering the whole solution space are initialized randomly. This ensures that at-least one firefly has a high intensity. All the other fireflies start moving towards this brightest firefly. Since every firefly is associated with a degree of randomness, the whole solution space is thoroughly covered by the population of fireflies.

b. Fuzzy-Firefly Algorithm:
The fuzzy firefly algorithm, proposed by T. Hassanzade in 2014 [16], increased the area of exploration by each firefly and improves the convergence rate. To do this, in each iteration k-brighter fireflies are selected which attract the other less brighter fireflies.
Here, k is a user-defined parameter that depends upon the complexity of the problem and the swarm population. Taking h as a brighter firefly with fitness value f(p h ) and the local optimum firefly has its fitness value f(p g ), the degree of attractiveness of the firefly h is defined as: Here, β is defined as Here, l is a user-set parameter. The movement of a less brighter firefly i towards one of the k-brighter fireflies h is formulated as: In the implementation of this algorithm, the value of 0  is taken as 1, γ is taken in the range [0.01,100], k is taken as 15 and α ϵ [0,1].

C. Similarity Measures:
Out of the several measures used to find similarity between two data points, the most popular one is the Euclidean distance, has the limitation of being sensitive to initial assignment of centroids and being stable for only linearly separable data points. The second limitation can be solved by Kernel based clustering approach wherein non-linear boundaries are created to segregate the data points efficiently. This is possible by transforming the data points present in the ordinary plane to a higher dimensional feature plane known as the kernel space. Some non-linear mapping function is used to ensure this kind of transformation. This subsection describes some of the similarity measures.

a. Euclidean Distance:
The Euclidean distance d ij between any two data points i and j is described as: This formula holds true across any n-dimensional space. Here 12 , ,... n x x x and 12 , ,... n y y y are attributes of x and y respectively. Where,

a. Davis-Bouldin (DB) index:
The DB index is the ratio of sum of distance within the cluster to between the clusters. It is given by the formula: It aims to minimize the separation within the cluster and maximize the between cluster separation. Hence a low value of DB index indicates good clustering.

b. Dunn (D) index:
D index is used to identify the compact and separated clusters. It is calculated as: It objective is to maximize the between-cluster distance and minimize the within-cluster distance. Therefore, a greater D index value indicates higher efficiency.

V. METHODOLOGY
The swarm of fireflies is initialized to random values and the metaheuristic is allowed to calculate the intensity of each firefly. These fireflies are allowed to move around following equation (10) and their intensities are recalculated. At the end of this cycle, the best firefly (centroid) values are passed as the initial values of clustering algorithms. We have used this technique for the Kernelized (Gaussian and Hyper-tangent) versions of the algorithms FCM, IFCM, RFCM, RIFCM and made a comparative analysis among themselves and the existing clustering algorithms in this direction. It is observed that the algorithms obtained through our approach not only show significant improvement (verified through the computation of the measuring indices DUNN and DB and results obtained) but also their rates of convergences are high. In this paper we have used five different type of images for our experimental purpose.

VI. RESULTS AND ANALYSIS
Implementation of algorithms have been carried out in Python 3.6 with Spyder 3.1.4 IDE. NumPy library has been used in the implementation of algorithms and matplotlib library has been used to plot the output figures. In the experimental analysis, we have used five different kinds of images in order to make the study extensive.
ORIGINAL DATASET:  It can be inferred from the above output ( Fig. 2) that FCM and IFCM produces roughly similar result while RFCM and RIFCM produces much better results. The output produced by FCM and IFCM are slightly blurred and noisy specially at the edges. Output produced by FCMFA, FCMFFA, IFCMFA, IFCMFFA, RFCMFA, RFCMFFA RIFCMFA, RIFCMFFA are marginally better than their original counterparts as is clear from the values of Dunn and DB indices and have a better convergence rate as shown in Fig 4. It can be observed that IFCM and IFCMFA works slightly better than IFCMFFA but have much higher convergence rate. In case of RIFCM, the convergence improves more rapidly than any other algorithm when combined with Firefly and Fuzzy-Firefly algorithm. The convergence rate is fastest in the case of IFCMFFA. b. Using Gaussian Kernel:   It can be easily inferred from table 1 that the results produced using Gaussian Kernel (Fig. 5) is much better than that produced using Euclidean distance (Fig. 2). The indices show that Firefly and Fuzzy Firefly versions of the algorithm works better than their conventional counterpart in all the three cases and show much better convergence rate. Figure 7 shows a significant improvement of convergence rate of GKRIFCM when combined with Firefly and Fuzzy Firefly algorithms. Thus, GKRIFCMFFA shows the best results as well as the best convergence rate. Finally, the following relations can be established based on the performance indices: It can be inferred from Fig. 8    It can be inferred from Fig. 13 and 14 that the outputs are significantly better than those rendered using Euclidean measures. It is also evident that GKFCM, GKRFCM and GKRIFCM produces better results than GKIFCM. It can be established by referring to the performance indices that in GKFCM, GKRFCM and GKRIFCM both firefly and fuzzy firefly gives better results. In case of GKIFCM, it is difficult to establish any concrete relation. GKIFCMFFA shows the best convergence rate closely followed by GKRFCMFFA.
The optimized versions show better convergence rate in all the cases. We may conclude the following relations:  It can be observed from Fig. 18 that RIFCM performs much better than FCM, IFCM and RFCM. The output produced by FCM and IFCM are quite blurred and unrecognizable. The cracks in the ground are much sharper and distinguishable in case of RFCM and even better in case of RIFCM. The performance values obtained supports our observation. The firefly and fuzzy firefly versions show marginal improvements in the cluster quality and significant improvement in the convergence rate. RFCMFFA gives the best convergence rate, which is significantly better than its original version (RFCM). Thus, the following relation holds good: The output produced by Hyper-tangent kernel is similar to that produced by Gaussian Kernel. Convergence rate also shows good improvement. HKRIFCM does not show any stable relation both in the cluster quality and the convergence rate. The improvement in convergence rate from HKRIFCM to HKRIFCMFFA is quite remarkable. Finally, the following relation can be established: HKFCM<HKFCMFA<HKFCMFFA, HKIFCMFFA<HKIFCM<HKIFCMFA, HKRFCM<HKRFCMFA<HKRFCMFFA, HKRIFCM<HKRIFCMFA<HKRIFCMFFA, HKIFCM<HKFCM<HKRFCM<HKRIFCM

D. Segmentation of Geographical Image-Hills a. Using Euclidean Distance:
It can be observed that the results produced by FCM and IFCM are quite similar. Also results produced by RFCM and RIFCM are very similar and it is quite difficult to differentiate between them. So, we rely on the performance indices for our analysis. The results produced by Firefly and Fuzzy Firefly are better than their existing counterparts both in terms of quality of cluster and convergence rate. The results produced by RIFCMFFA is better than all other algorithms. IFCMFFA shows the best convergence rate followed by RFCMFFA.    It is evident from the values of performance indices that Gaussian Kernelized versions produce much better results. The indices show that GKFCM, GKRFCM, GKRIFCM perform better than GKIFCM. The graph in fig. 36 shows the improvement of algorithms as they transition from their naï ve form to firefly and then to fuzzy firefly. The indices prove that GKRIFCMFFA gives the best result in very few iterations. GKIFCMFFA shows the best convergence rate. Referring to the bar graph, the following relation between efficiency of algorithms can be established: GKFCM<GKFCMFA<GKFCMFFA, GKIFCMFA<GKIFCM<GKIFCMFFA, GKRFCM<GKRFCMFA<GKRFCMFFA, GKRIFCM<GKRIFCMFA<GKRIFCMFFA, GKIFCM<GKFCM<GKRFCM<GKRIFCM.
c. Using Hyper-tangent Kernel: Hyper-tangent kernelized versions produces better results than Gaussian versions. The graph in fig. 36 shows remarkable improvements specially in case of HKRFCM and HKRIFCM during their transition from original version to firefly and fuzzy firefly versions. The performance indices show that HKRIFCMFFA forms the best clusters. From fig 38, it can be observed that HKRFCMFFA shows the best convergence rate closely followed by HKRIFCMFFA. Referring the bar graphs, the following order of efficiency of algorithms can be established: HKFCM<HKFCMFA<HKFCMFFA, HKIFCMFFA<HKIFCM<HKIFCMFA, HKRFCM<HKRFCMFA<HKRFCMFFA, HKRFCM<HKRFCMFA<HKRFCMFFA, HKIFCM<HKFCM<HKRFCM<HKRIFCM VII. SUMMARY Through the above observations, it is quite evident that Firefly and Fuzzy Firefly show improvements both in performance indices as well as the convergence rate, which has been verified through DB and Dunn indices. It can be said that RIFCM gives the best results while IFCM and FCM shows comparable results with IFCM giving slightly better results than FCM and RFCM gives better results than FCM and IFCM. However, in kernelized versions, FCM, RFCM and RIFCM outperform IFCM. Moreover, it is established that Hypertangent Kernel gives slightly better result than Gaussian Kernel. The kernelized versions gave significantly better results than their Euclidean counterpart. So, RIFCM combined with Hyper-tangent kernel and fuzzy firefly algorithm gives the best result amongst all other cases. Also, the performance of kernelized IFCM combined with firefly and fuzzy firefly does not show any stable relation. Thus, we could establish that firefly and fuzzy firefly prove to be efficient optimization algorithms and improve the performances of clustering algorithms on combination.

VIII. CONCLUSION
In this paper, we have successfully fused firefly and fuzzy firefly algorithms with the existing clustering algorithms and analyzed the performance of these algorithms with the existing algorithms. Fusing clustering algorithms with firefly and fuzzy firefly algorithm renders stability to the clustering output and improves the convergence rate of the algorithms. Fuzzy firefly manages to outperform the firefly algorithm by producing better outputs in fewer iterations. These meta heuristic algorithms find the cluster centers that are closer to the actual cluster centers, thus giving better results than those produced by assigning random centers. Replacing the Euclidean distance formula with the Gaussian and Hypertangent kernels enables the algorithms to cluster nonlinearly separable data. We have successfully established relations among these algorithms.