<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink">
<front><article-meta>
<title-group><article-title>Imbalanced Data Clustering Using Improved AFCM Algorithm Based on Whale Optimization Algorithm</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Ghaderi</surname><given-names>Seyedeh Fatemeh</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Abbasi</surname><given-names>Hamid</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Shokouhinia</surname><given-names>Mojtaba</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<aff id="aff1">Department of Computer Engineering, Da.C., Islamic Azad University, Damghan, Iran.</aff>
</contrib-group>
<abstract><p>Accurate clustering in data mining faces serious challenges, especially when the data is unbalanced. In unbalanced data, traditional Fuzzy Clustering Algorithms (FCM) usually do not have sufficient accuracy and do not correctly identify minority classes due to their tendency to create clusters of equal size. To reduce the effect of this limitation, in this research, a novel approach is presented in which the adaptive FCM is improved using the Whale Optimization Algorithm (WOA). By purposefully exploring the response space, the whale algorithm adjusts the parameters of the adaptive FCM optimally and therefore reduces the probability of the algorithm getting stuck in local optima. Experimental evaluations on standard Iris and Thyroid datasets show that the proposed method achieves values of 97.14% and 94.71% for F1-Score and Balanced Accuracy (BA) metrics, respectively. This improvement in evaluation criteria indicates that the proposed method has a higher ability to manage the side effects of data imbalance and maintain the true structure of clusters compared to FCM and other basic methods.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Clustering</kwd><kwd>Unbalanced data</kwd><kwd>Data mining</kwd><kwd>Adaptive fuzzy algorithm</kwd><kwd>Whale optimization algorithm</kwd></kwd-group>
</article-meta></front>
<body>
<sec id="sec-1"><label>1</label><title>Introduction</title>
<p>The rapid growth of various sciences, especially in the fields of medicine and engineering, has led to the production of large volumes of data. To properly use this information, its careful analysis is of great importance. Clustering is one of the main approaches in unsupervised learning, which aims to group data based on their similarity <xref ref-type="bibr" rid="ref-1">[1]</xref>. Clustering applications include various fields such as marketing, disease diagnosis in medicine, image processing, and anomaly detection <xref ref-type="bibr" rid="ref-2">[2]</xref>, <xref ref-type="bibr" rid="ref-3">[3]</xref>. Although existing algorithms can identify clusters of various shapes, most of them operate only based on physical criteria such as distance and density and face difficulties in selecting appropriate parameters <xref ref-type="bibr" rid="ref-4">[4]</xref>. In many real-world applications, data is not uniformly distributed, which has made &quot;imbalanced data&quot; a major issue in recent years. When faced with unbalanced data, traditional algorithms tend to focus on the majority class, which leads to ignoring the minority class and reducing the accuracy of sensitive case detection <xref ref-type="bibr" rid="ref-5">[5]</xref>. The Fuzzy Clustering Algorithm (FCM), which is one of the most widely used clustering methods, suffers from a phenomenon called the &quot;monotonic effect&quot; when dealing with unbalanced data; This means that it tends to create clusters of equal size, resulting in poor output <xref ref-type="bibr" rid="ref-6">[6]</xref>. Furthermore, FCM is sensitive to the initial center values and, in many cases, gets stuck in local optima <xref ref-type="bibr" rid="ref-1">[1]</xref>. To overcome the limitations of the classical method, metaheuristic algorithms were introduced. Unlike deterministic methods, these algorithms do not require gradient information and have a good ability to escape local optima. One of these evolutionary methods, the Whale Optimization Algorithm (WOA), inspired by the feeding behavior of humpback whales, has been introduced and has attracted attention due to its extensive search capability, simplicity of parameter settings, and reasonable convergence speed <xref ref-type="bibr" rid="ref-5">[5]</xref>. Various studies have shown that clustering methods based on the whale algorithm provide better performance in data clustering compared to well-known algorithms such as the genetic algorithm, particle swarm optimization, and artificial bee colony <xref ref-type="bibr" rid="ref-7">[7]</xref>. Also, the results of combining this algorithm with other strategies have shown that the WOA can be used as an effective alternative to improve clustering accuracy in complex datasets <xref ref-type="bibr" rid="ref-9">[8]</xref>. Considering the limited ability of fuzzy methods to deal with unbalanced data and the remarkable performance of the WOA in searching for suitable solutions, an improved version of the Adaptive Fuzzy Clustering Algorithm (AFCM) is proposed in this paper. The goal of this approach is to better tune the parameters and cluster centers with the help of WOA to reduce the probability of getting stuck on inappropriate responses and increase the accuracy of detecting instances related to the minority class.</p>
</sec>
<sec id="sec-2"><label>2</label><title>Theoretical Foundations</title>
<sec id="sec-3"><label>2.1</label><title>Unbalanced Data</title>
<p>Unbalanced data is one of the fundamental challenges in clustering algorithms. In these datasets, the data distribution is such that the number of samples belonging to one or more classes (minority class) is significantly lower compared to other classes (majority class) <xref ref-type="bibr" rid="ref-10">[9]</xref>, <xref ref-type="bibr" rid="ref-11">[10]</xref>. This imbalance causes clustering objective functions, which are adjusted based on the general density of the data, to bias towards densely populated clusters and ignore clusters belonging to minority classes <xref ref-type="bibr" rid="ref-11">[10]</xref>. Mathematically, the degree of imbalance in a dataset can be defined by the Imbalance Ratio (IR):</p>
<p>Nmajority</p>
<p>IR = , (1)</p>
<p>Nminority where ∣ Nmajority| and ∣ Nminority| represent the number of samples of the majority class and the minority class, respectively. When the IR value is significantly larger than one, traditional algorithms such as FCM are unable to detect the structure of minority clusters due to their focus on reducing the mean error, and thus classify them as noise or part of the majority classes <xref ref-type="bibr" rid="ref-12">[11]</xref>, <xref ref-type="bibr" rid="ref-13">[12]</xref>.</p>
</sec>
<sec id="sec-4"><label>2.2</label><title>Fuzzy Clustering Algorithm</title>
<p>Clustering is a fundamental part of unsupervised pattern recognition. Its goal is to group unlabeled samples into several categories so that the data within each category is most similar and the data in different categories is distinct from each other <xref ref-type="bibr" rid="ref-1">[1]</xref>. The similarity criterion varies depending on the application. But usually the distance, density, and distribution pattern of the data play a major role. The FCM algorithm is the most common fuzzy method in which each sample belongs to a cluster with a certain membership degree. Simplicity and understandability are the strengths of this method <xref ref-type="bibr" rid="ref-14">[13]</xref>. However, this method is sensitive to the initialization of cluster centers and, in many cases, tends to a local optimal response. Especially when the problem dimensions are large, deterministic search methods such as the gradient method usually suffer from these weaknesses. For this reason, the clustering problem is often considered as a multivariate optimization problem <xref ref-type="bibr" rid="ref-1">[1]</xref>.</p>
<p>The FCM algorithm performs data clustering by minimizing the following objective function:</p>
<p>J(U, V) = ∑. ∑ u ⋅ ‖xk − vi‖ , (2)</p>
<p>ik i=1 k=1</p>
<p>j is the main objective function to be minimized. c is the number of clusters, and n is the number of data samples. U is the membership degree of the k-th sample in the ith cluster, and m is the fuzzification parameter, which usually has a value greater than 1. v is the center of the ith cluster. x represents the feature vector of the k-th sample (input dataset). ‖xk − vi‖ represents the Euclidean distance between xk and the cluster center vi. Then, the cluster centers are updated at each iteration using the following equation:</p>
<p>∑ uik ⋅ xk</p>
<p>vi = . (3)</p>
<p>∑ uik</p>
</sec>
<sec id="sec-5"><label>2.3</label><title>Adaptive Fuzzy Clustering Algorithm</title>
<p>The FCM algorithm is one of the most widely used fuzzy clustering methods due to its simplicity and efficiency. However, in unbalanced and noisy datasets, its performance suffers from reduced accuracy. In this algorithm, using constant parameters causes the clustering process to be unable to adapt to variations in cluster density and unbalanced data distribution. For this purpose, the AFCM has been proposed with the aim of increasing the flexibility of the clustering process. In AFCM, algorithm parameters are adjusted adaptively to the data characteristics during algorithm execution. As a result, samples belonging to minority classes and low-density areas play a more effective role in determining the centers of clusters. This feature increases the accuracy in determining cluster centers, reduces the impact of outliers, and prevents the majority classes from dominating the clustering process. Finally, AFCM provides more accurate and robust clustering than FCM on unbalanced datasets <xref ref-type="bibr" rid="ref-15">[14]</xref>. To deal with the challenge of non-uniform data distribution, the AFCM algorithm modifies the standard FCM objective function as follows:</p>
<p>c n C</p>
<p>J = ∑. ∑ u ⋅ ‖x − v ‖ + λ ∑ φ (v ). (4)</p>
<p>AFCM ik k i i i=1 k=1 i=1</p>
<p>Uik is the membership degree of the k-th sample in the i-th cluster, and m is the fuzzification parameter. vi is the center of the i-th cluster and xk represents the feature vector of the k-th sample (input dataset). φ(v is a penalty function that is adjusted based on the local density of the data and allows the algorithm to increase the weighting of minority classes using the adaptive parameter λ. The cluster centers are updated at each iteration using the following equation:</p>
<p>∑ uik ⋅ xk</p>
<p>vi = . (5)</p>
<p>∑ uik This mathematical structure causes the centers of clusters to also tend towards less dense areas (minority classes) rather than just focusing on densely populated clusters.</p>
</sec>
<sec id="sec-6"><label>2.4</label><title>Whale Optimization Algorithm</title>
<p>Population-based metaheuristic algorithms are inspired by natural processes and have become very popular in solving complex problems due to their simplicity of implementation and independence from gradient information <xref ref-type="bibr" rid="ref-16">[15]</xref>. These methods usually have a good ability to escape from local optima. The WOA is a metaheuristic algorithm inspired by the hunting behavior of humpback whales. These whales use a unique method called &quot;bubble net feeding.&quot; The hunting process consists of two main phases. During the exploitation phase, whales surround the prey and move towards it in a spiral motion. In the exploration phase, they seek new paths to increase the likelihood of finding better answers. What increases the efficiency of the WOA algorithm is its flexible way of switching between broad search and precise search modes. This displacement is set by a control parameter (vector A). In the mathematical model of the algorithm, when the absolute value of this vector is greater than one (|A| ≥1), the algorithm agents move away from the reference point and perform an extensive search in space <xref ref-type="bibr" rid="ref-17">[16]</xref>. On the other hand, if its value is less than one, the movements are focused towards the reference point, and an accurate search is formed. This flexible behavior helps WOA algorithm avoid premature halting at undesirable solutions in complex, multidimensional spaces, such as many clustering problems <xref ref-type="bibr" rid="ref-5">[5]</xref>, <xref ref-type="bibr" rid="ref-17">[16]</xref>.</p>
</sec>
</sec>
<sec id="sec-7"><label>3</label><title>Proposed Method</title>
<p>In this research, a hybrid method is proposed to overcome the limitations of the FCM in unbalanced data. The main focus of the proposed model is to assign the initialization of cluster centers, which is one of the weaknesses of classical methods, to the WOA. This approach allows the algorithm to explore the search space to find true centers, rather than getting stuck in local optima (which in unbalanced data leads to the elimination of the minority class).</p>
<sec id="sec-8"><label>3.1</label><title>Solution Coding</title>
<p>In the proposed method, each &quot;whale&quot; or search agent represents a complete set of cluster centers. Assuming the dataset has K clusters and D features, each whale is encoded as a continuous vector, as shown in Eq. (5):</p>
<p>X = [c{11}, c{12}, … , c{KD}], (6)</p>
<p>where X is the position vector of a whale, cij represents the coordinates of the center of the ith cluster in the jth dimension (feature), K is the total number of clusters, and D represents the dimensions of the data.</p>
</sec>
<sec id="sec-9"><label>3.2</label><title>Fitness Function</title>
<p>In the proposed algorithm, each whale provides a possible solution (a set of cluster centers). To measure the quality of these solutions, a criterion called a &quot;fitness function&quot; is needed. Here, the fitness function is exactly the same as the cost function of the AFCM algorithm, denoted by the symbol jm. This function calculates the sum of weighted distances of all data to the proposed centers. Therefore, the goal of the whale algorithm is to minimize the value of this function, which is defined in Eq. (6), by moving the centers:</p>
<p>Jm = ∑ ∑ u{ } ∥ Xi − Cj ∥ . (7)</p>
<p>ij i=1 j=1</p>
<p>Uij is the membership degree of the ith sample in the jth cluster, and m is the fuzzification parameter, which usually has a value greater than 1. xi represents the feature vector of the ith sample (input dataset). C is the number of clusters and N is the number of data samples . cj is the center of the j-th cluster. ‖xi − Cj‖ represents the Euclidean distance between xi and the cluster center Cj. The lower the value of Jm, the more compact and accurate the clustering is.</p>
</sec>
<sec id="sec-10"><label>3.3</label><title>Updating Positions</title>
<p>At each iteration, whales adjust their position based on the current best solution (x ). If the whale is in the &quot;prey encirclement&quot; or &quot;spiral movement&quot; phase (i.e., when the probability value p ≥ 0.5), its new position is calculated based on Eq. (7):</p>
<p>bl ∗ (8)</p>
<p>X(t + 1) = D. e . cos(2πl) + x (t), where D represents the distance of the whale from the current best position, b is a logarithmic constant that determines the shape of the spiral of the movement, and l is a random number in <xref ref-type="bibr" rid="ref-1">[1-1]</xref>. If the whale is in the “search” phase (p &lt; 0.5) and wants to explore a new region of the problem space (a state where ∣A∣≥1), the new position is calculated using Eq. (9):</p>
<p>X(t + 1) = xrand−A. |C . X{rand} − X(t)|. (9)</p>
<p>In the above equation, x_rand represents the position of a whale that is randomly selected from the population. Using this mechanism helps prevent the search path from becoming monotonous and the algorithm from getting stuck in local optima that are very common in unbalanced data.</p>
</sec>
</sec>
<sec id="sec-11"><label>4</label><title>Experimental Result</title>
<p>To evaluate the efficiency of the proposed method, two standard datasets from the UCI Machine Learning (ML) repository, Iris and Thyroid, were utilized. While the Thyroid dataset is challenging due to its imbalanced classes, the Iris dataset is recognized as a benchmark for assessing the clustering algorithms&apos; capability due to the overlapping structure among its classes:</p>
<p>I. Iris Dataset consists of 150 samples in 3 equal classes (50 samples in each class), which was evaluated as a standard and balanced dataset to measure the basic performance of the algorithms.</p>
<p>II. Thyroid Dataset contains 215 samples related to thyroid status (normal, hyperactive, hypoactive). In this dataset, the majority class (normal) was retained, and the other two classes were severely reduced to simulate severe imbalance conditions.</p>
<sec id="sec-12"><label>4.1</label><title>Evaluation Metrics</title>
<p>In order to measure the efficiency of the proposed method and compare it with other algorithms, three standard metrics, including accuracy, Normalized Mutual Information (NMI), and Adjusted Rand Index (ARI), have been used.</p>
<p>Accuracy: The simplest metric for evaluating clustering performance and represents the ratio of the number of correctly labeled samples to the total samples:</p>
<p>∑i=1 ai</p>
<p>Accuracy = × 100, (10)</p>
<p>where k is the number of classes, n is the total number of data points, and ai is the number of samples correctly identified in class i.</p>
<p>NMI: This metric is used to measure the amount of shared information between two partitions (real clustering and algorithm clustering) and is independent of the number of clusters:</p>
<p>2 × I(X; Y)</p>
<p>NMI(X, Y) = , (11)</p>
<p>H(X) + (H)Y where I(X; Y) is the mutual information between the actual labels X and predicted Y, and H(X) and H(Y) are the related entropies. An NMI value close to 1 indicates a perfect match.</p>
<p>ARI index: This index eliminates the chance of clustering being random and measures the similarity between two clustering methods.</p>
<p>ai bj</p>
<p>(∑i( )) (∑j( ))</p>
<p>nij 2 2</p>
<p>∑ij( ) −</p>
<p>ARI = , (12)</p>
<p>ai bj</p>
<p>(∑i( )) (∑j( )) 1 a b 2 2 [∑i( ) + ∑j( )] − 2 2 2 n</p>
<p>where n is the total number of samples, nij is the number of samples in common between the actual class i and the predicted cluster j, and ai and bj are the sum of samples of class i and cluster j, respectively. An ARI value close to 1 indicates perfect matching and desired clustering.</p>
<sec id="sec-13"><title>Precision &amp; recall</title>
<p>The precision metric measures the accuracy and purity of the model, while the Recall metric measures the completeness or ability of the model to correctly identify the target class.</p>
<p>TP</p>
<p>Precision = , (13)</p>
<p>TP + FP where True Positive (TP) is the number of samples that are correctly labeled in the target class and False Positive (FP) is the number of samples that are incorrectly labeled in this class.</p>
<p>TP</p>
<p>Recall = , (14)</p>
<p>TP + FN where False Negative (FN) represents the number of samples from the target class that the algorithm failed to identify and mistakenly placed in another cluster.</p>
</sec>
<sec id="sec-14"><title>F1-SCORE</title>
<p>The harmonic mean of the two measures Precision and Recall. This metric is especially important in unbalanced data because it penalizes extreme values and prevents the model from falsely overestimating its overall performance simply by ignoring the minority class. For this reason, the F1-Score is a good measure for assessing the balance between accuracy and coverage in unbalanced problems. A value close to 1 indicates successful performance of the algorithm in both areas:</p>
<p>(2 × Precision × Recall)</p>
<p>F1 − Score = (Precision + Recall). (15)</p>
<p>Balanced Accuracy (BA) is proposed to address the &quot;accuracy paradox&quot; problem in unbalanced data. This index ensures that the model&apos;s performance is measured fairly across all classes (both majority and minority) by calculating the arithmetic mean of sensitivity (TP rate) and specificity (TN rate):</p>
<p>TN</p>
<p>Specificity = , (16)</p>
<p>TN + FP Recall + Specificity</p>
<p>Balanced Accuracy = . (17)</p>
<p>It indicates the model&apos;s ability to correctly identify samples of the opposite class (TN or TP).</p>
</sec>
</sec>
<sec id="sec-15"><label>4.2</label><title>Result Analysis</title>
<p>In order to evaluate the quality of clustering, the following evaluation criteria were used: Accuracy, NMI, and ARI. Also, to evaluate the performance of algorithms fairly and accurately on minority classes in an unbalanced dataset, metrics extracted from the confusion matrix, such as the F1-Score and BA metrics, have been used.</p>
</sec>
<sec id="sec-16"><label>4.3</label><title>Comparison of Algorithms Efficiency</title>
<p><xref ref-type="table" rid="tab1">Table 1</xref> shows the results of applying different algorithms to the studied dataset. As can be seen from <xref ref-type="table" rid="tab1">Table 1</xref>, the proposed WOA-AFCM method outperforms other methods in all criteria. In the Iris dataset, the FCM algorithm has provided an accuracy of 85.71% due to being stuck in local optima. The Reptile Search Algorithm (RSA)-FCM method, by improving the initial search, was able to reach 89.33% accuracy, but it was still unable to completely separate overlapping data.</p>
<table-wrap id="tab1"><label>Table 1</label><caption><p>Comparing the performance of different clustering algorithms.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:5:66,43.7,537.1,135.9"/><p content-type="note">This table is shown in the PDF version of the article.</p></table-wrap>
<p>On the other hand, the proposed method using the whale spiral search mechanism has identified the best primary centers and achieved an accuracy of 97.14% and an ARI index equal to 0.9320. These values indicate the high matching of the formed clusters with the real classes.</p>
<p>In the Thyroid dataset, the performance of the algorithms has been evaluated based on two criteria, NMI and ARI; two valid indices that evaluate the degree of matching of the resulting clustering structure with the actual labels of the data, independent of the mere matching of the samples. In the Thyroid dataset, the classic FCM algorithm is unable to effectively separate minority samples, and as a result, it has obtained lower values of NMI and ARI indices. This performance degradation is due to the significant imbalance between the classes, as well as the dependency of the FCM algorithm on the cluster structures with relatively uniform distribution and sensitivity to the dominance of the majority classes. Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) algorithm had the weakest performance with 86.51% accuracy. This issue is because this algorithm identifies data from lower-density classes (overactive/underactive patients) as noise and excludes them from the clustering process, leading to a drastic decrease in NMI and ARI metrics. In the proposed WOA-AFCM method, by using the adaptive weighting mechanism and optimizing the cluster centers with the WOA algorithm, it has been able to make the clustering structure more consistent with the real data distribution. This issue has led to a significant increase in the values of both NMI and ARI criteria. In particular, a higher value of ARI indicates a greater matching of the generated clusters with the real structure of the classes, after removing the effect of random matching. The results indicate a higher ability of the proposed method in identifying minority samples and maintaining the real boundaries between classes. These results show that WOA-AFCM is not only more stable in the face of unbalanced data, but also able to represent the inherent structure of the data more accurately and improve the clustering quality more significantly than the classic methods. By overcoming the imbalance problem, the proposed method has been able to increase the accuracy to 92.94%.</p>
<fig id="fig1"><label>Figure 1</label><caption><p>Performance of standard FCM on the Iris dataset.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:6:66,193.9,537.1,428.1"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
<fig id="fig2"><label>Figure 2</label><caption><p>Visualization of final cluster distribution on the Iris dataset.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:7:66,541.2,537.1,778.6"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
<p>In order to visually evaluate the performance of the algorithm, the initial data distribution of the Iris dataset and the clustering results obtained from the proposed method are presented in <xref ref-type="fig" rid="fig3">Fig. 3</xref>. <xref ref-type="fig" rid="fig3">Fig. 3</xref>.a shows the initial distribution of data samples before clustering, while <xref ref-type="fig" rid="fig3">Fig. 3</xref>.b shows the final output of the WOA-AFCM algorithm after the clustering process. Comparing these two figures indicates that the proposed method was able to identify the data structure well and create clusters with appropriate resolution and desirable compliance with the actual data distribution. In the Thyroid dataset, the majority class tends to attract the cluster centers, which leads to the minority classes (patients) being ignored. <xref ref-type="table" rid="tab2">Table 2</xref> shows the performance of the proposed algorithm focusing on minority classes. As can be seen from <xref ref-type="table" rid="tab2">Table 2</xref>, the performance of the algorithm with severe imbalance in the Thyroid dataset has been examined separately. The FCM algorithm fails to detect minority classes (patients) due to the high prevalence of the majority class (normal). Therefore, FCM records zero values for the evaluation of minority classes due to placing all samples in one cluster. In contrast, the results show that the proposed WOA-AFCM method has successfully overcome the attraction of the majority class and extracted the hidden structure of the minority classes. In minority class number 3, the algorithm has shown outstanding performance. An F1-score of 0.7273 and a BA of 0.8303 are evidence of the high ability of the hybrid algorithm to accurately locate cluster centers and distinguish the boundaries of the class, despite the limited number of samples. In minority class number 2, the model&apos;s behavior is extremely conservative. A prediction accuracy (precision) of 1.00 indicates that the model had no FP errors in this class and that all samples assigned to this cluster belonged to class 2 with complete certainty. Although the low recall rate in this class indicates a strong structural overlap between class 2 and majority class samples, the overall average shows that the whale-global-search (WOA) mechanism in fuzzy center optimization is an effective solution to prevent the phenomenon of &quot;minority class swallowing&quot; in complex medical data. In order to evaluate the performance of the algorithms in facing the imbalance challenge, accurately, a comparison of the evaluation criteria of the basic FCM algorithm and the proposed WOA-AFCM method on the Thyroid dataset is presented in <xref ref-type="fig" rid="fig4">Fig. 4</xref>. As can be seen from <xref ref-type="fig" rid="fig4">Fig. 4</xref>, the FCM algorithm has poor results in the F1-Score and BA metrics, which provide a more accurate assessment of the model&apos;s performance on unbalanced data. These undesirable results are due to the algorithm&apos;s sensitivity to class imbalance and the influence of the dominance of the majority classes. The result indicates that FCM faces limitations in correctly identifying minority samples and maintaining a balance of performance across classes. In contrast, the proposed WOA-AFCM method has been able to significantly increase the F1-Score and BA values while maintaining a high overall accuracy value. The successful performance of the proposed WOA-AFCM method is based on the utilization of cluster center optimization through the WOA and the adaptive clustering mechanism. The improvement in evaluation parameters indicates increased accuracy in identifying minority samples, reduced bias towards majority classes, and better balance in classification performance. Overall, the results show that the proposed method has a greater ability to handle unbalanced data compared to FCM and provides more stable and reliable performance in representing structure and identifying minority classes. Using the WOA to determine the initial cluster centers has increased the algorithm&apos;s ability to extract the true structure of the data, reduce the effect of majority class dominance, and create more balanced clustering. As a result, the increase in the overall performance of the proposed method is not only due to the improvement in general accuracy, but also reflects the improvement in the quality of clustering and proper separation of all classes, especially</p>
<fig id="fig3"><label>Figure 3</label><caption><p>Comparison of Iris dataset clustering: a. Initial distribution of data points, and b. Final clustering result using the proposed algorithm with 97.14% accuracy.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:8:65.9,215.5,537.1,682.1"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
<table-wrap id="tab2"><label>Table 2</label><caption><p>Performance evaluation of different algorithms on minority classes (Thyroid dataset).</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:8:66,86.7,537.1,157.3"/><p content-type="note">This table is shown in the PDF version of the article.</p></table-wrap>
<fig id="fig4"><label>Figure 4</label><caption><p>Comparison of the standard FCM algorithm and the proposed WOA-AFCM method performance based on various evaluation metrics on the imbalanced Thyroid dataset.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:9:66,534.3,537.1,778.6"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
</sec>
<sec id="sec-17"><label>4.4</label><title>Convergence Analysis</title>
<p>In order to examine the behavior of the algorithms in reaching the optimal solution, the convergence graph for the three implemented algorithms (FCM, RSA-FCM, WOA-AFCM) is plotted in <xref ref-type="fig" rid="fig5">Fig. 5</xref>. The above graph shows that the FCM algorithm (blue line) stalls in the early iterations and is trapped in a local optimum with a high cost value. The RSA-FCM algorithm (green line) has better performance, but its convergence slope is slower than the proposed method. In contrast, the WOA-AFCM algorithm (red line) not only reduced the cost function value faster, but also managed to converge to the lowest final value. The result shown in the figure proves that the WOA has a high ability to escape local traps and guide cluster centers towards global</p>
<fig id="fig5"><label>Figure 5</label><caption><p>Comparison of the convergence behavior of the algorithms based on the cost function.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:9:65.9,97.8,537.1,349.3"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
</sec>
</sec>
<sec id="sec-18"><label>5</label><title>Conclusion</title>
<p>In this study, a new hybrid algorithm called WOA-AFCM was proposed to overcome the limitations of fuzzy clustering, including high sensitivity to initialization and a tendency to fall into local optima. The performance of the proposed method was evaluated on two standard datasets, Iris and Thyroid. Experimental results showed that the proposed method, utilizing the intelligent global search mechanism of the WOA, achieved an accuracy of 97.14% on the Iris dataset and 94.71% on the unbalanced Thyroid dataset. The results prove significant superiority over the classical methods such as FCM, RSA-FCM, and HDBSCAN. Detailed analyses have been conducted on the metrics extracted from the confusion matrix, especially the F1-Score (0.7273 for the minority class) and the BA (0.8303). Based on these results, the proposed algorithm has been able to successfully overcome the &quot;majority class dominance&quot; phenomenon, unlike traditional methods that suffer from structural failure in unbalanced data and ignore minority classes. Moreover, convergence graphs analysis indicates that the WOA-AFCM method converges towards the absolute optimum of the cost function with higher speed and greater stability. Finally, achieving high NMI and ARI indices confirms the very accurate matching of the generated clusters with the real data structure, making this method an efficient option for complex engineering and medical applications.</p>
<p>Given the findings of this study, there are broad research paths for developing this approach, including Implementation in big data frameworks, developing multi-objective models, and applying deep learning models. Given that in this research, the focus was on optimizing a cost function. It is suggested that in future work, by combining the whale algorithm and other optimizers, a multi-objective model can be designed that simultaneously optimizes &quot;clustering accuracy&quot; and &quot;convergence speed&quot;. Moreover, given the computational complexity of AFCM, implementing this algorithm on parallel processing platforms such as Spark or GPUs for working with very large datasets would be a valuable step. Finally, examining the ability to automatically extract features using deep neural networks (Autoencoders) and feed them to the WOA-AFCM algorithm can push the current boundaries of accuracy in distinguishing minority classes.</p>
</sec>
<sec id="sec-19"><title>Authors&apos; Contributions</title>
<p>All aspects of the research and manuscript preparation were carried out by the author. The author has read and approved the final version of the manuscript.</p>
</sec>
<sec id="sec-20"><title>Funding</title>
<p>Not applicable.</p>
</sec>
<sec id="sec-21"><title>Data Availability</title>
<p>All data supporting the reported findings in this research paper are provided within the manuscript.</p>
</sec>
<sec id="sec-22"><title>Conflict of Interest</title>
<p>The author declares that they do not have any conflict of interest.</p>
</sec>
<sec id="sec-23"><title>Consent for Publication</title>
<p>The author confirms consent for the publication of this work</p>
</sec>
<sec id="sec-24"><title>Ethics Approval and Consent to Participate</title>
<p>This article does not contain any studies with human participants performed by the author.</p>
</sec>
</body>
<back><ref-list><title>References</title>
<ref id="ref-1"><label>1</label><mixed-citation>Wang, S., Shao, C., Xu, S., Yang, X., &amp; Yu, H. (2024). MSFSS: A whale optimization-based multiple sampling feature selection stacking ensemble algorithm for classifying imbalanced data. AIMS mathematics, 9(7), 17504–17530. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3934/math.2024851">https://doi.org/10.3934/math.2024851</ext-link></mixed-citation></ref>
<ref id="ref-2"><label>2</label><mixed-citation>Oskouei, A. G., Samadi, N., Khezri, S., Moghaddam, A. N., Babaei, H., Hamini, K., ... &amp; Arasteh, B. (2025). Feature-weighted fuzzy clustering methods: An experimental review. Neurocomputing, 619, 129176. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.neucom.2024.129176">https://doi.org/10.1016/j.neucom.2024.129176</ext-link></mixed-citation></ref>
<ref id="ref-3"><label>3</label><mixed-citation>Kalaycı, T. A., &amp; Asan, U. (2022). Improving classification performance of fully connected layers by fuzzy clustering in transformed feature space. Symmetry, 14(4), 658. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3390/sym14040658">https://doi.org/10.3390/sym14040658</ext-link></mixed-citation></ref>
<ref id="ref-4"><label>4</label><mixed-citation>Wang, Y., Pang, W., &amp; Jiao, Z. (2023). An adaptive mutual K-nearest neighbors clustering algorithm based on maximizing mutual information. Pattern recognition, 137, 109273. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.patcog.2022.109273">https://doi.org/10.1016/j.patcog.2022.109273</ext-link></mixed-citation></ref>
<ref id="ref-5"><label>5</label><mixed-citation>Zeraatkar, S., &amp; Afsari, F. (2021). Interval-valued fuzzy and intuitionistic fuzzy-KNN for imbalanced data classification. Expert systems with applications, 184, 115510. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.eswa.2021.115510">https://doi.org/10.1016/j.eswa.2021.115510</ext-link></mixed-citation></ref>
<ref id="ref-6"><label>6</label><mixed-citation>Liu, F., Wang, J., &amp; Liu, Y. (2024). IMI2: A fuzzy clustering validity index for multiple imbalanced clusters. Expert systems with applications, 238, 122231. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.eswa.2023.122231">https://doi.org/10.1016/j.eswa.2023.122231</ext-link></mixed-citation></ref>
<ref id="ref-7"><label>7</label><mixed-citation>Mirjalili, S., &amp; Lewis, A. (2016). The whale optimization algorithm. Advances in engineering software, 95, 51–</mixed-citation></ref>
<ref id="ref-8"><label>67</label><mixed-citation><ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.advengsoft.2016.01.008">https://doi.org/10.1016/j.advengsoft.2016.01.008</ext-link></mixed-citation></ref>
<ref id="ref-9"><label>8</label><mixed-citation>Liu, Y., Jiang, Y., Hou, T., &amp; Liu, F. (2021). A new robust fuzzy clustering validity index for imbalanced data sets. Information sciences, 547, 579–591. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.ins.2020.08.041">https://doi.org/10.1016/j.ins.2020.08.041</ext-link></mixed-citation></ref>
<ref id="ref-10"><label>9</label><mixed-citation>Wang, J., Wang, S., &amp; Zhang, Y. (2025). Deep learning on medical image analysis. CAAI transactions on intelligence technology, 10(1), 1–35. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1049/cit2.12356">https://doi.org/10.1049/cit2.12356</ext-link></mixed-citation></ref>
<ref id="ref-11"><label>10</label><mixed-citation>Hoseini, S. S., &amp; Abbasi, S. H. (2017). A new method for community detection in social networks based on message distribution. International journal of computer science and network security, 17(5), 298–308. <ext-link ext-link-type="uri" xlink:href="https://www.researchgate.net/profile/Hamid-Abbasi-13/publication/358214918">https://www.researchgate.net/profile/Hamid-Abbasi-13/publication/358214918</ext-link></mixed-citation></ref>
<ref id="ref-12"><label>11</label><mixed-citation>Japkowicz, N., &amp; Stephen, S. (2002). The class imbalance problem: A systematic study. Intelligent data analysis, 6(5), 429–449. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3233/IDA-2002-6504">https://doi.org/10.3233/IDA-2002-6504</ext-link></mixed-citation></ref>
<ref id="ref-13"><label>12</label><mixed-citation>He, H., &amp; Garcia, E. A. (2009). Learning from imbalanced data. IEEE transactions on knowledge and data engineering, 21(9), 1263–1284. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/TKDE.2008.239">https://doi.org/10.1109/TKDE.2008.239</ext-link></mixed-citation></ref>
<ref id="ref-14"><label>13</label><mixed-citation>Zheng, M., Li, T., Zheng, X., Yu, Q., Chen, C., Zhou, D., ... &amp; Yang, W. (2021). UFFDFR: Undersampling framework with denoising, fuzzy c-means clustering, and representative sample selection for imbalanced data classification. Information sciences, 576, 658-680. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.ins.2021.07.053">https://doi.org/10.1016/j.ins.2021.07.053</ext-link></mixed-citation></ref>
<ref id="ref-15"><label>14</label><mixed-citation>Yue, X. D., Miao, D. Q., Cao, L. B., Wu, Q., &amp; Chen, Y. F. (2014). An efficient color quantization based on generic roughness measure. Pattern recognition, 47(4), 1777–1789. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.patcog.2013.11.017">https://doi.org/10.1016/j.patcog.2013.11.017</ext-link></mixed-citation></ref>
<ref id="ref-16"><label>15</label><mixed-citation>Arslan, H., &amp; Toz, M. (2019). Data clustering based on fuzzy c-means and chaotic whale optimization algorithms. Sigma journal of engineering and natural sciences, 37(4), 1107–1128. <ext-link ext-link-type="uri" xlink:href="https://sigma.yildiz.edu.tr/storage/upload/pdfs/1635862524-en.pdf">https://sigma.yildiz.edu.tr/storage/upload/pdfs/1635862524-en.pdf</ext-link></mixed-citation></ref>
<ref id="ref-17"><label>16</label><mixed-citation>Ahmed, A. M., Rashid, T. A., Hassan, B. A., Majidpour, J., Noori, K. A., Rahman, C. M., ... &amp; Mohammed, N. B. (2024). Balancing exploration and exploitation phases in whale optimization algorithm: An insightful and empirical analysis. In Handbook of whale optimization algorithm (pp. 149-156). Academic Press. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/B978-0-32-395365-8.00017-8">https://doi.org/10.1016/B978-0-32-395365-8.00017-8</ext-link></mixed-citation></ref>
</ref-list></back>
</article>