Full text
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/346870373 DBIG-US: A two-stage under-sampling algorithm to face the class imbalance problem ArticleinExpert Systems with Applications · November 2020 DOI: 10.1016/j.eswa.2020.114301 CITATIONS 3 READS 63 4 authors, including: Some of the authors of this publication are also working on these related projects: Machine Learning Methods for Credit Scoring Problems: Data Complexity, Ensembles,Performance Measures, Feature Representation View project Dynamic Classifier Selection View project Angélica Guzmán Universidad Autónoma del Estado de México (UAEM) 8 PUBLICATIONS5 CITATIONS SEE PROFILE Josep Salvador Sánchez Universitat Jaume I 155 PUBLICATIONS3,135 CITATIONS SEE PROFILE Rosa María Valdovinos Universidad Autónoma del Estado de México (UAEM) 72 PUBLICATIONS576 CITATIONS SEE PROFILE All content following this page was uploaded by Rosa María Valdovinos on 17 February 2021. The user has requested enhancement of the downloaded file.
Expert Systems With Applications xxx (xxxx) xxx Please cite this article as: A. Guzmán-Ponce, Expert Systems With Applications, https://doi.org/10.1016/j.eswa.2020.114301 Available online 12 November 2020 0957-4174/Published by Elsevier Ltd. Contents lists available at ScienceDirect Expert Systems With Applications journal homepage: www.elsevier.com/locate/eswa DBIG-US: A two-stage under-sampling algorithm to face the class imbalance problem A. Guzmán-Ponce a,b,∗, J.S. Sánchezb, R.M. Valdovinos a, J.R. Marcial-Romero a aFacultad de Ingeniería, Universidad Autónoma del Estado de México, Cerro de Coatepec s/n, Ciudad Universitaria, 50100 Toluca, Mexico bInstitute of New Imaging Technologies, Department of Computer Languages and Systems, Universitat Jaume I, 12071 Castelló de la Plana, Spain ARTICLE INFO Keywords: Imbalance problem Under-sampling Cluster analysis DBSCAN Graph theory ABSTRACT The class imbalance problem occurs when one class far outnumbers the other classes, causing most traditional classifiers perform poorly on the minority classes. To tackle this problem, a plethora of techniques have been proposed, especially centered around resampling methods. This paper introduces a two-stage method that combines the DBSCAN clustering algorithm to filter noisy majority class instances with a graph-based procedure to overcome the class imbalance. We then experimentally evaluate the behavior of the proposed method on a collection of two-class imbalanced data sets. The experimental results show an improvement in the classification performance measured by the geometric mean of the accuracy on each class and also a higher reduction in the imbalance ratio when compared to several state-of-the-art under-sampling techniques. 1. Introduction The term ‘class imbalance’ refers to the situation in which the prior class probabilities are very different, that is, the number of instances in one class (often the one of prime interest) is much smaller than the amount of data available in the other classes. This form of imbalance is known as between-class imbalance or intrinsic imbalance, while the within-class imbalance or small disjuncts occurs when one class consists of several sub-clusters of different amount of instances (Ali et al., 2015;Thabtah et al.,2020). For a two-class problem, the minority and majority classes are usually referred to as positive (𝐶+) and negative (𝐶−), respectively (Kang et al.,2017). Class imbalance is considered as one of the most challenging problems in data mining, machine learning and knowledge discovery, especially because standard learning models are strongly biased to favor the majority class. Since positive instances are under-represented, they are likely guessed as noise or outliers, or assigned to the majority class regardless the value of their features (García et al.,2019b;Haixiang et al., 2017). The problem of class imbalance is common to many real-world application domains such as fraud detection (Hassan & Abraham,2016; Zhu et al.,2020b), medical diagnosis (Bach et al.,2017;Wang et al., 2020), credit risk and bankruptcy prediction (García et al.,2019a;Kim et al.,2015;Marqués et al.,2013), fault detection (Codetta-Raiteri & ∗Corresponding author at: Facultad de Ingeniería, Universidad Autónoma del Estado de México, Cerro de Coatepec s/n, Ciudad Universitaria, 50100 Toluca, Mexico. E-mail addresses: [email protected] (A. Guzmán-Ponce), [email protected] (J.S. Sánchez), [email protected] (R.M. Valdovinos), [email protected] (J.R. Marcial-Romero). Portinale,2015;Yang et al.,2020) and document categorization (Bruni & Bianchi,2020;Jiang et al.,2019), to cite just a few examples. Most techniques proposed in the literature to face the class imbalance problem can be categorized into three main groups: datalevel or external, algorithmic-level or internal, and cost-sensitive methods (Fernández et al.,2018). The data-level approach is based on a preprocessing step to rebalance the class distribution by either undersampling the majority class and/or over-sampling the minority class. The algorithmic-level approach creates or adapts the learning model for biasing the discrimination process toward the minority class. Finally, the cost-sensitive methods combine both data- and algorithmic-level approaches considers the varying costs of different misclassification types, and assign higher misclassification costs to the minority class. Apart from these strategies, ensemble learning appears as another option to handle the class imbalance problem (Galar et al.,2012;Haixiang et al., 2017). In general, the data-level solutions are the most popular and the most widely used because they are independent of the underlying classifier and can be easily implemented for any problem (Lin et al.,2017). This paper is motivated by two observations. First, we concentrate on the under-sampling approach because the ever-increasing amount of data generated in many scientific and engineering domains makes oversampling techniques much more expensive in memory and computational requirements for further classification tasks. On the other hand, https://doi.org/10.1016/j.eswa.2020.114301 Received 17 January 2020; Received in revised form 6 November 2020; Accepted 9 November 2020
Expert Systems With Applications xxx (xxxx) xxx 2 A. Guzmán-Ponce et al. the use of under-sampling techniques has also shown a positive effect on classifier performance, becoming a de facto strategy to work with asymmetric distributions (Drummond & Holte,2003;Pozzolo et al., 2015). From the various strategies proposed for under-sampling the class-imbalanced data sets, we have chosen to use a clustering-based design because several related works have shown better performance when compared to neighborhood-based developments (Cao & Shen, 2019;Haixiang et al.,2017;Tsai et al.,2019;Yen & Lee,2009). According to the experiments carried out in those works, the clustering-based under-sampling strategy can reduce the risk of removing meaningful data from the majority class (Lin et al.,2017); however, practical difficulties of this approach relate to the need of setting the number of clusters for an optimal clustering result, the possibility of changing the original distribution in the majority class because of the process to select or define representative samples from each cluster, and also the limited reduction in the imbalance ratio (Tsai et al.,2019). Taking into account the pros and cons of the clustering-based undersampling techniques, we propose a new method, called DBIG-US, which is based on the use of the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm (Ester et al.,1996) and a graph-based procedure. Firstly, the DBSCAN depicts a filtering step to identify and remove noisy negative instances and then, the graphbased step produces a representative sub-sample of the majority class with a pre-established maximum imbalance ratio. By exhaustive experimentation, the proposed method is compared with some state-of-the-art under-sampling techniques on a large pool of two-class imbalanced data sets. The main benefits of the DBIG-US algorithm can be summarized as follows: •It strengthens the visibility of the minority class. •It ‘‘cleans’’ the majority class by eliminating noise and removing borderline instances. •It allows setting a maximum degree of imbalance. Henceforward, this paper is organized as follows. Section 2summa- rizes a collection of related works. The DBIG-US algorithm proposed here is introduced in Section 3. Next, Section 4presents the experimental databases and describes the experimental setup. The results are discussed in Section 5. Finally, Section 6remarks the main conclusions and outlines some avenues for further research. 2. Related works Some data preprocessing methods combine under-sampling with an ensemble through the well-known boosting and bagging techniques (Lin et al.,2017). For instance, the RUSBoost (RBt) algorithm proposed by Seiffert et al. (2010) combines random under-sampling with a boosting algorithm for building an ensemble of classifiers. Other examples are EasyEnsemble (EE) and BalanceCascade (BC) (Liu et al.,2009), which both follow the idea of under-sampling by splitting the data into multiple subsets of the majority class and training an ensemble built on each subset; after this, the resampled data set is obtained by merging the best instances from each subset. The main difference between EE and BC is that the former is an unsupervised strategy to explore the data set by using random sampling with replacement, while the latter explores the data set in a supervised way. On the other hand, Kang et al. (2017) developed a noise-filtered under-sampling method (EE-KF), where the minority class is noise-filtered through removing instances whose all neighbors belong to the majority class and then, the majority class is under-sampled by the EasyEnsemble algorithm. Solutions for class-imbalanced problems within the data-level approach focus on changing the class distribution of the data set by either under-sampling and/or over-sampling. While the under-sampling algorithms reduce the size of the majority class by removing some negative instances, the over-sampling methods augment the number of minority class instances. In general, the result of the under-sampling approach benefits from some computational advantages because it picks up a subset of the majority class for training, making the learning process faster and more efficient (Liang & Zhang,2012). Under-sampling can be conducted simply just by removing some majority class instances at random, but it can lead to loss of some potentially meaningful information. More advanced under-sampling techniques are based on some intelligent identification of less important negative instances to be eliminated. These methods can be categorized into two groups: neighborhood-based and clustering-based. 2.1. Neighborhood-based algorithms The Hart’s condensing (CNN) algorithm (Hart,1968) uses the concept of consistent subset to eliminate the majority class instances that are sufficiently far away from the decision boundary because these are considered to be irrelevant for learning. Analogously, the Tomek links (TL) (Tomek,1976) have also been employed to remove the majority class instances since, if two instances form a Tomek link, then either one of these is noise or both instances are borderline. Kubat and Matwin (1997) proposed the one-sided selection (OSS) technique, which selectively removes only those negative instances that either are redundant or border the minority class instances (assuming that these bordering cases are noise): the borderline instances are detected using the Tomek links, while the redundant ones are eliminated with Hart’s condensing. A similar method corresponds to the CNN-TL algorithm (Batista et al.,2004) which firstly finds a consistent subset and then applies the procedure based on the Tomek links. Unlike the one-sided selection technique, the neighborhood cleaning (NCL) rule (Laurikkala,2001) concentrates more on data filtering than on data reduction; to this end, Wilson’s editing (ENN) (Wilson, 1972) is employed to identify and remove noisy negative instances. According to the authors, NCL performs better than OSS and processes noisy instances more carefully. However, this method is strongly biased in favor of the minority class and leads to poor specificity and overall accuracy. 2.2. Clustering-based algorithms Yoon and Kwek (2005) proposed the class purity maximization algorithm, which intends to split the majority class into dense clusters; the idea is to determine negative instances that are far away from the decision boundary, that is, to find as many clusters of majority class instances as possible that do not contain any positive instances or at most very few minority instances. The under-sampling based on clustering (SBC) proposed by Yen and Lee (2006) clusters all the training instances into 𝐾clusters and selects an appropriate number of majority class samples from each cluster by considering the ratio of the number of majority class instances to the number of minority class instances in the derived cluster. Similarly, Longadge (2013) proposed an undersampling method that firstly clusters the majority class instances into 𝐾groups using the 𝐾-means algorithm, and then selects |𝐶+|∗𝐼𝑅𝑖 majority class instances from each cluster 𝑖, where 𝐼𝑅𝑖denotes the imbalance ratio in the cluster 𝑖. Rahman and Davis (2013) proposed a method based on clustering the majority class into 𝐾clusters. Each cluster is combined with all the minority class instances to create 𝐾training sets, which are then classified with a decision tree and the fuzzy unordered rule induction algorithm. Finally, the training set with the highest accuracy is designated as the final under-sampled data set for classification. The aim of this algorithm is not to obtain a data set with a majority to minority ratio of 1:1, but to reduce the difference in the size of the majority and minority classes. The ClusterOSS technique introduced by Barella et al. (2014) is a modification of the OSS method. It starts by using the 𝐾-means
Expert Systems With Applications xxx (xxxx) xxx 3 A. Guzmán-Ponce et al. algorithm to cluster the majority class instances. Then, the closest instances to the center of each cluster are used to start the application of OSS, removing borderline and noisy negative instances using the Tomek links. Unlike OSS, this technique does not start the under-sampling process at random, but defines how many and which instances should be chosen by applying the 𝐾-means clustering algorithm. Sobhani et al. (2015) developed the ClusFirstClass algorithm that employs the 𝐾-means clustering and ensemble learning methods in order to obtain a balanced data set. First, majority class instances are clustered into 𝐾groups and then, at least one instance from each cluster is selected to combine with all minority class instances, prior to training. Finally, to reduce information loss due to choosing small number of majority instances in highly imbalanced data sets, an ensemble is used to train several base learners with different subsets of majority class instances. Chennuru and Timmappareddy (2017) proposed the MahalCUSFilter algorithm, which divides all the majority class instances into 𝐾 subsets based on the distance from their centroid and takes a number of negative instances from each subset using stratified sampling; this means that the number of instances to be chosen from each cluster depends on its size, and the total number of majority class instances to be chosen from all the groups is equal to the number of minority class instances in the data set. Thus the set with all minority class instances and selected the majority class instances form a balanced set. Finally, the negative instances that are misclassified with the nearest neighbor classifier are removed. Lin et al. (2017) introduced two under-sampling strategies in which the 𝐾-means clustering technique is used. Unlike the proposals described previously, the number of clusters with majority class instances is defined to be equal to the size of the minority class. The first strategy uses the cluster centers to represent the majority class, whereas the second strategy uses the nearest neighbors of the centers. In the Fast- CBUS (fCBUS) method designed by Ofek et al. (2017), the minority class is clustered into 𝐾clusters by the 𝐾-means algorithm and for each cluster, a similar number of majority class instances close to the minority class instances are sampled. Tsai et al. (2019) presented the CBIS approach, which is based on clustering analysis and an instance selection process. Firstly, the affinity propagation algorithm groups similar majority class instances into a number 𝐾of clusters. After this first step, the instance selection process is applied to filtering out instances in each cluster. Finally, all reduced 𝐾clusters together with the instances of minority class form a balanced data set. 3. The DBIG-US algorithm The under-sampling method proposed here differs from most cluster-based under-sampling algorithms in at least two questions. First it does not require to specify the number of clusters, which can be seen as an important advantage because this number is often unknown in advance, and second it allows to set the maximum imbalance ratio, say 𝑚𝑎𝑥𝐼𝑅, that the resampled data set can tolerate. Fig. 1 shows the general workflow of the BIG-US algorithm, which comprises two stages: the filtering step and the under-sampling step. It starts by dividing a two-class imbalanced data set of 𝑛=𝑛++ 𝑛−instances (where 𝑛+≪ 𝑛−denote the number of positive and negative instances, respectively) into a subset 𝐶−with the majority class instances and a subset 𝐶+containing the minority class instances. Afterward, it comprises two steps: (i) the filtering step runs the DBSCAN clustering algorithm on the majority class to produce a noise-free set of majority class instances (𝐶− 1), and (ii) the graph-based step consists of the ShapeGraph algorithm to obtain an induced subgraph whose vertices represent a subset of the majority class (𝐶− 2) with an imbalance ratio 𝐼𝑅 ≤𝑚𝑎𝑥𝐼𝑅. Finally, 𝐶+is combined with 𝐶− 2to produce a balanced data set. The proposed DBIG-US method is formally described in Algorithm 1. The filtering step (lines 3–6) applies DBSCAN until the free parameters do not change, and then the under-sampling step (see Section 3.2) is performed (line 7) to finally produce a balanced data set. Fig. 1. General workflow of the proposed DBIG-US method. Algorithm 1 DBIG-US Input: 𝐷𝑆 = {𝑝1, 𝑝2,…, 𝑝𝑛},𝑚𝑎𝑥𝐼𝑅 Output: 𝐷𝑆𝑏𝑎𝑙𝑎𝑛𝑐𝑒𝑑 1: Split 𝐷𝑆 into two subsets 𝐶−and 𝐶+ 2: 𝐶− 1←𝐶− 3: repeat 4: Compute 𝜖and 𝑚𝑖𝑛𝑃 𝑡𝑠. 5: 𝐶− 1←DBSCAN(𝐶− 1,𝜖,𝑚𝑖𝑛𝑃 𝑡𝑠). 6: until 𝜖and 𝑚𝑖𝑛𝑃 𝑡𝑠 do not change 7: 𝐶− 2←ShapeGraph(𝐶− 1,𝑅𝑚𝑎𝑥,𝐶+) 8: 𝐷𝑆𝑏𝑎𝑙𝑎𝑛𝑐𝑒𝑑 ←𝐶+∪𝐶− 2 3.1. Filtering step DBSCAN is a clustering algorithm, which assumes that the clusters correspond to dense regions in the space. This algorithm can discover groups without any prior knowledge about the number of clusters in the data, and it works well with noisy data sets. DBSCAN in its original proposal (Kumar & Rangan,2007) requires two input parameters: 𝜖defines the radius of the neighborhood region, and 𝑚𝑖𝑛𝑃 𝑡𝑠 establishes the minimum number of instances that might be part of the 𝜖-neighborhood to form a cluster. In our proposal, the input values of DBSCAN were modified according to Eqs. (1) and (2) to guarantee that the cluster formed by the majority class is free of noise and the decision border is cleaned. 𝜖=√∑|𝐶−| 𝑖=1 𝑑𝑖𝑠𝑡(𝑚, 𝑝− 𝑖) |𝐶−|(1) where 𝑚is the middle vector of the majority class, 𝑝− 𝑖represents a majority class instance, 𝑑𝑖𝑠𝑡 corresponds to the Euclidean distance between 𝑝𝑖and 𝑚and |𝐶−|denotes the number of majority class instances. 𝑚𝑖𝑛𝑃 𝑡𝑠 =𝜋×𝜖2 𝑇 𝑜𝑡𝑎𝑙𝑉 𝑜𝑙𝑢𝑚𝑒 ×|𝐶+|(2) where 𝑇 𝑜𝑡𝑎𝑙𝑉 𝑜𝑙𝑢𝑚𝑒 =4 3×𝜋×𝜖3and |𝐶+|is the number of minority class instances. Bearing in mind that DBSCAN is here applied only on the majority class, it takes a negative instance 𝑝− 𝑖at random and looks for all reachable instances with respect to 𝜖and 𝑚𝑖𝑛𝑃 𝑡𝑠. If 𝑝− 𝑖does not have at least 𝑚𝑖𝑛𝑃 𝑡𝑠 neighboring instances at a distance 𝜖, then it is marked as noisy and removed from the set 𝐶−. This process is repeated until the values of the input parameters 𝑚𝑖𝑛𝑃 𝑡𝑠 and 𝜖do not change. 3.2. Under-sampling step After removing noisy and borderline negative instances with DBSCAN, the process is refined using a graph-based technique to reduce the size of the majority class with the aim of obtaining an imbalance
Expert Systems With Applications xxx (xxxx) xxx 4 A. Guzmán-Ponce et al. ratio lower than or equal to 𝑚𝑎𝑥𝐼𝑅.Appendix A provides the concepts and notation on graph theory that are needed in this section. Let 𝐶− 1 be the majority class produced by DBSCAN, then a weighted graph 𝐺𝑤= (𝑉 , 𝐸)can be built as follows: •𝑉(𝐺𝑤) = 𝐶− 1, •𝐸(𝐺𝑤) = {{𝑣, 𝑢} ∣ 𝑣, 𝑢 ∈𝑉(𝐺𝑤)}, and •for each 𝑒= {𝑣, 𝑢} ∈ 𝐸(𝐺𝑤),𝑤(𝑒) = 𝑑(𝑣, 𝑢)where 𝑑(𝑣, 𝑢)is the Euclidean distance between 𝑣and 𝑢. The rationale behind considering the majority class as the set of vertices of a weighted graph 𝐺𝑤is to determine which instances are furthest away from each other. The ShapeGraph algorithm will be in charge of under-sampling the majority class by generating an induced subgraph of 𝐺𝑤with a set of vertices whose size will be updated according to Eq. (3) and stored in the variable Sample until reaching an imbalance ratio equal to 𝑚𝑎𝑥𝐼𝑅 (lines 2–7 in Algorithm 2). 𝑓(𝑥) = ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ |𝐶− 1|𝜎2𝑍2 𝑒2(|𝐶− 1|−1)+𝜎2𝑍2if 𝑥= 1 𝑓(𝑥−1) 𝜎2𝑍2 𝑒2(|𝐶− 1|−1)+𝜎2𝑍2otherwise (3) where 𝑍= 1.96,𝜎= 0.5and 𝑒= 0.05 for a confidence level of 95%. After obtaining the size of the majority class subset (stored in Sample), the algorithm computes the adjacency matrix of 𝐺𝑤(line 9) with the distance between each pair of instances (edges). The function GetMaximum gives a set of edges (pairs of instances) with a maximum distance in the adjacency matrix (line 11). For each edge in this set, the vertices that have not been visited yet will be marked and added to the majority class subset 𝐶− 2(lines 12–20). Algorithm 2 ShapeGraph Input: 𝐶− 1,𝑅𝑚𝑎𝑥,𝐶+ Output: 𝐶− 2 1: Build 𝐺𝑤= (𝑉 , 𝐸)a weighted graph with 𝑉=𝐶− 1 2: 𝑆𝑎𝑚𝑝𝑙𝑒 ←|𝐶− 1| 3: 𝐼𝑅 ←𝑆𝑎𝑚𝑝𝑙𝑒 |𝐶+| 4: while 𝐼𝑅 > 𝑚𝑎𝑥𝐼𝑅 do 5: 𝑆𝑎𝑚𝑝𝑙𝑒 ←𝑆𝑎𝑚𝑝𝑙𝑒 𝜎2𝑍2 𝑒2(|𝐶− 1|−1)+𝜎2𝑍2 6: 𝐼𝑅 ←𝑆𝑎𝑚𝑝𝑙𝑒 |𝐶+| 7: end while 8: 𝐶− 2←[] 9: 𝑀𝐺←adjacencyMatrix(𝐺𝑤) 10: while |𝐶− 2|< 𝑆𝑎𝑚𝑝𝑙𝑒 do 11: Maximum ←GetMaximum(𝑀𝐺) 12: for all {𝑣, 𝑢}in Maximum do 13: if 𝑣has not been visited then 14: Mark 𝑣as visit 15: 𝐶− 2←𝐶− 2∪ {𝑣} 16: end if 17: if 𝑢has not been visited then 18: Mark 𝑢as visit 19: 𝐶− 2←𝐶− 2∪ {𝑢} 20: end if 21: Remove {𝑣, 𝑢}from 𝑀𝐺 22: end for 23: end while 24: return 𝐶− 2 In general, the graph-based process discards instances that are not close enough to the decision border. Note that Eq. (3) determines the size of the majority class, and it is applied iteratively until the ratio between the computed value and the cardinality of the minority class is close to that given by the user. Table 1 Main characteristics of the data sets. # Data set #Features Class distribution #Instances IR 1 yeast05679v4 8 51–477 528 9.35 2 vowel0 13 90–898 988 9.98 3 glass016v2 9 17–175 192 10.29 4 glass2 9 17–197 214 11.59 5 shuttle0v4 9 123–1706 1829 13.87 6 yeast1v7 7 30–429 459 14.30 7 glass4 9 13–201 214 15.47 8 ecoli4 7 20–316 336 15.80 9 pagBks13v4 10 28–444 472 15.86 10 glass016v5 9 9–175 184 19.44 11 shuttle2vs4 9 6–123 129 20.50 12 yeast1458vs7 8 30–663 693 22.10 13 glass5 9 9–205 214 22.78 14 yeast2vs8 8 20–462 482 23.10 15 flareF 11 43–1023 1066 23.79 16 yeast4 8 51–1433 1484 28.10 17 yeast1289v7 8 30–917 947 30.57 18 yeast5 8 44–1440 1484 32.73 19 ecoli0137v26 7 7–274 281 39.14 20 abalone17v78910 8 58–2280 2338 39.31 21 yeast6 8 35–1449 1484 41.40 22 shuttle2v5 9 49–3267 3316 66.67 23 kddBfOfw-b 41 30–2203 2233 73.43 24 poker89v5 10 25–2050 2075 82.00 3.3. Time complexity As can be seen in Algorithm 1, DBIG-US consists of two steps. The time complexity of the first step is given by the run time complexity of the DBSCAN clustering algorithm, which is (𝑛2)in the worst-case (Suthar et al.,2013). The second step of DBIG-US corresponds to ShapeGraph (Algorithm 2) whose time complexity is also (𝑛2). In this case, the complexity is mostly governed by the following set of instruction: •Updating Sample and 𝐼𝑅 (lines 4–7) has a complexity of 𝑛. •Computing the adjacency matrix (line 9) has a complexity of 𝑛2. •Generating a majority class subset of size Sample (lines 10–23) has a complexity of 𝑛2, which comes from 𝑛iterations to compute the set 𝑀𝑎𝑥𝑖𝑚𝑢𝑚 with a complexity of 𝑛. Taking into account that DBIG-US depends on DBSCAN and Shape- Graph, the time complexity of the proposed algorithm becomes (𝑛2) in the worst-case. 4. Experimental study A set of experiments were designed to evaluate the performance of the under-sampling algorithm proposed here. The experiments consist of comparing DBIG-US with various well-known under-sampling methods on 24 two-class data sets taken from the KEEL Data Set Repository (https://sci2s.ugr.es/keel/imbalanced.php#subA). The number of instances varies from 129 to 3.316, the number of features ranges from 7 to 41, and the imbalance ratio (IR, the ratio of the majority class size to the minority class size) is between 9.35 and 82. Table 1 summarizes the main characteristics for these data sets, which are sorted in ascending order of the imbalance ratio. Apart from DBIG-US, we also implemented the random undersampling (RUS) approach, 4 neighborhood-based algorithms, 3 ensemble-based methods and 4 clustering-based algorithms to validate the performance of the proposal. •Random under-sampling (RUS). •Neighborhood-based: NCL, TL, ENN, OSS. •Ensemble-based: BC, RUSBoost (RBt), EE-KF (EEKF). •Clustering-based: SBC, CBU, Fast-CBUS (fCBUS), CBIS, DBIG-US.
Expert Systems With Applications xxx (xxxx) xxx 5 A. Guzmán-Ponce et al. Table 2 Confusion matrix. Classified as positive Classified as negative Actual positive True Positive (TP) False Negative (FN) Actual negative False Positive (FP) True Negative (TN) The base classifiers of all tested algorithms were the nearest neighbor rule (1-NN) and the C4.5 decision tree in order to obtain fair comparisons between the under-sampling approaches. The parameters of C4.5 were adopted as default values of the WEKA framework (Hall et al.,2009). For all data sets, the maximum imbalance ratio (𝑅𝑚𝑎𝑥) allowed in the proposed DBIG-US algorithm was set to 1. The experiments were carried out using the 10-fold cross-validation method. Each original data set is randomly divided into ten stratified parts of size 𝑛∕10, where 𝑛denotes the total number of instances in the data set; for each fold, nine blocks are used as a training set, and the remaining portion comprises the test set. 4.1. Assessment metrics To assess the classification performance on two-class imbalanced data sets, it is commonly used a 2 ×2 confusion matrix as that given in Table 2, where each entry (𝑖, 𝑗)contains the number of correct/incorrect classifications (Kang et al.,2017). From this, four counts can be easily derived: the number of true positives (actually positive, and classified as positive), true negatives (actually negative, and classified as negative), false positives (actually negative, but classified as positive), and false negatives (actually positive, but classified as negative). Apart from the overall accuracy, other metrics can be calculated based on these counts, including the balanced correction rate or geometric mean of the accuracy on each class, the area under the ROC curve and the F-measure. All these reflect a trade-off between TPR and TNR without regard to class distribution or misclassification costs and therefore, these metrics are more suitable for class-imbalanced problems (García et al.,2014). In the experiments of this paper, the classification performance of algorithms was evaluated with the geometric mean of the accuracies: 𝑔=√𝑇 𝑃 𝑅 ⋅𝑇 𝑁𝑅 where 𝑇 𝑃 𝑅 =𝑇 𝑃 ∕(𝑇 𝑃 +𝐹 𝑁)is the sensitivity or true-positive rate (i.e., the accuracy on the minority class) and 𝑇 𝑁𝑅 =𝑇 𝑁∕(𝑇 𝑁 +𝐹 𝑃 ) is the specificity or true-negative rate (i.e., the accuracy on the majority class). 5. Results and discussion To investigate the performance of the DBIG-US algorithm, this section is divided into four blocks. First, the effect of DBSCAN and the induced subgraph procedure has been analyzed separately to determine the synergy between both methods in DBIG-US. Second, the geometric mean will evaluate the effectiveness of the proposed method as compared with 14 state-of-the-art under-sampling techniques. Third, the imbalance ratio and its reduction percentage that result from the application of the under-sampling approaches will be analyzed. Finally, both performance measures will be put together to better understand the behavior of each under-sampling algorithm. 5.1. DBIG-US vs its components Results in Table 3 show the performance of the two algorithms involved in DBIG-US separately: the DBSCAN clustering algorithm and the induced subgraph (ShapeGraph). Results obtained over the data sets with no preprocessing have also been included for comparison purposes. Values reported in bold type represent the best result obtained on each data set. As expected, the DBSCAN algorithm by itself improved the results obtained with the non-preprocessed data sets, which is likely due to the noise filtering process of this algorithm. However, DBSCAN did not achieve the best performance results. Analyzing the results of the induced subgraph and the DBIG-US method, it can be observed that both outperformed the results obtained over the data sets with no preprocessing and also those processed by DBSCAN. Although ShapeGraph achieved the highest average geometric mean, differences with DBIG-US were mostly small. Taking these results into account, it is important to highlight the advantages of the DBIG-US. First, remember that the induced subgraph is constructed by considering only the farthest samples from the center and those closest to the border between classes. In some cases, this situation could hinder the behavior of the classifier, mainly when the classes are strongly overlapped. On the other hand, even though DBIG-US also employs the induced subgraph, it firstly cleans the decision boundary by applying the DBSCAN algorithm, thus moving away the intra-class boundaries. In this way, it is possible to have the benefits of both algorithms: to obtain a representative subset from the majority class, clean the decision border and reduce the class imbalance. Hence, results in Table 3 suggest that our proposal (the two-stage method) can be a better solution rather than its components when the data set suffers not only from class imbalance but also from other intrinsic data complexities such as noise. 5.2. DBIG-US performance vs other methods In Appendix B,Tables B.11 and B.12 respectively report the geometric mean (averaged across the 10 runs) of each method using the 1-NN and C4.5 classifiers on all 24 data sets. We also included the classification results on the original (baseline) data sets, which can be deemed as a baseline (reference). Besides, the last rows in these tables show the average geometric mean and the Friedman’s average rank for each under-sampling algorithm. Values in boldface highlight the best performing method in each data set. Fig. 2 displays the Friedman’s average rank of each algorithm (last row in Tables B.11 and B.12). From these bar graphs, we can observe that DBIG-US achieved the lowest average ranks, which means that the method proposed here can be deemed as the best performing algorithm. We also conducted pair-wise comparisons between DBIG-US and the state-of-the-art algorithms to further validate the performance of DBIG-US. Tables 4 and 5summarize the comparisons for the 1-NN and C4.5 classifiers respectively, where the symbol ‘‘+’’ denotes that DBIG-US outperformed the algorithm to be compared, ‘‘=’’ indicates that both achieved the same performance, and ‘‘–’’ means that DBIGUS performed worse than the method in comparison. The last column shows how many times the performance of DBIG-US was superior to that of the other algorithms on each data set, while the last row reports the total number of times that DBIG-US was better/same/worse (W/T/L) than the method of the column. Table 4 shows that DBIG-US was better than RUSBoost (RBt) and CBU on 19 out of the 24 data sets, but it was worse on the remaining 4 and 3 data sets, respectively. DBIG-US also outperformed the nonpreprocessed option, TL and OSS on 17 and 16 databases respectively, and it was better than RUS on 16 data sets. The performance of DBIGUS was still superior than ENN and NCL on 15 and 13 databases, respectively. From these results, it is possible to observe that DBIGUS yielded better classification performance than the state-of-the-art algorithms on most databases using the 1-NN classifier. Similar reseults were obtained when the C4.5 classifier was used (Table 5). Firstly, DBIG-US was better than NCL on 19 data sets. It also outperformed the SBC method on 18 data sets and ENN on 17 data sets. Regarding the clustering-based methods, DBIG-US was better than Fast-CBUS and CBIS on 17 data sets respectively. Thus, the overall performance of DBIG-US was higher than the other methods on most databases.
Expert Systems With Applications xxx (xxxx) xxx 6 A. Guzmán-Ponce et al. Table 3 Classification results of DBIG-US and its components. 1NN C4.5 Baseline DBSCAN ShapeGraph DBIG-US Baseline DBSCAN ShapeGraph DBIG-US yeast05679v4 61.2 62.9 93.7 81.9 65.1 60.7 87.9 76.1 vowel0 100 99.9 100 99.9 96.9 97.2 96.0 96.7 glass016v2 47.0 67.7 91.1 88.4 52.3 63.04 94.1 77.5 glass2 40.7 64.8 93.9 90.5 53.1 64.0 97.0 84.3 shuttle0v4 99.6 99.6 99.6 99.6 100 99.6 100 100 yeast1v7 62.3 57.9 94.9 79.3 54.3 50.8 84.9 63.3 glass4 86.6 89.4 88.4 96.1 82.2 92.3 80.7 91.9 ecoli4 86.3 86.3 94.9 94.9 82.9 80.1 81.4 81.5 pagBks13v4 98.2 98.2 98.1 98.1 96.2 96.2 94.3 94.3 glass016v5 81.0 94.3 88.9 94.3 99.4 99.7 83.1 100 shuttle2vs4 91.3 91.3 91.3 91.3 90.9 91.3 100 100 yeast1458vs7 44.1 37.3 90.6 89.2 0.0 0.0 91.3 94.0 glass5 81.1 94.3 94.3 94.3 98.8 99.4 83.1 100 yeast2vs8 77.0 78.3 92.2 87.7 22.4 21.0 79.1 81.6 flareF 30.1 77.9 76.6 94.2 15.2 73.5 78.9 91.8 yeast4 58.8 55.4 88.4 91.5 53.9 56.0 82.3 88.6 yeast1289v7 47.6 52.8 94.9 91.5 48.2 45.2 96.5 84.3 yeast5 82.1 82.8 86.3 88.3 86.3 87.3 87.7 83.0 ecoli0137v26 83.7 83.7 65.5 65.5 84.4 84.4 57.1 57.1 abalone17v78910 50.6 44.7 97.2 97.8 34.7 33.3 92.7 92.7 yeast6 71.1 70.9 93.5 85.7 73.4 70.4 90.8 85.4 shuttle2v5 100 100 100 100 100 100 100 100 kddBfOfw 100 100 98.4 98.4 98.3 98.3 95.0 95.0 poker89v5 19.9 80.5 87.7 90.0 0.0 73.0 56.6 70.0 Avg. Gmean 70.9 77.9 91.7 91.2 66.2 72.4 87.1 87.0 Fig. 2. Friedman’s average ranks. As a further confirmation of the findings using the ranks and pairwise comparisons, we also ran a Holm’s post hoc test to find out statistically significant differences between our proposal and the rest of the algorithms. Holm’s test is a step-down procedure that sequentially checks the hypothesis ordered by their significance (García et al., 2010). Tables 6 and 7report the 𝑝-values obtained by applying the Holm’s post hoc test over the results of Friedman procedure. Holm’s test rejects those hypotheses that have an unadjusted 𝑝-value ≤0.00625 for both classifiers. The first column indicates the number of hypotheses, the order is according to their significance from the most to the lowest. DBIG-US and CBU were the control methods for the 1NN and C4.5 classifiers, respectively. The control method was chosen according to the best Friedman ranks: 4.58 (1NN) and 4.94 (C4.5). Values in Table 6 indicate that DBIG-US was significantly better than the original (Baseline), TL, CBU, OSS, and SBC methods using the 1NN classifier. However, when using the C4.5 classifier (Table 7), the Holm’s post hoc test found that there did not exist statistical differences between DBIG-US and CBU. According to the results of Holm’s post hoc test when the C4.5 classifier was used, the DBIG-US algorithm was not selected as the control method for comparison. Thus, the Wilcoxon’s paired signedrank test was also run to find out statistically significant differences between each pair of algorithms for two levels of significance (𝛼= 0.90 and 𝛼= 0.95). This statistic ranks the differences in performances of two algorithms for each data set, ignoring the signs, and compares the ranks for the positive and the negative differences (Demšar,2006). The upper diagonal half of Table 8 (1-NN classifier) and Table 9 (C4.5 decision tree) corresponds to 𝛼= 0.90 (10% or less chance), whereas the lower diagonal half is for a significance level of 0.95. The symbol ‘‘∙’’ indicates that the method of the row was significantly better
Expert Systems With Applications xxx (xxxx) xxx 7 A. Guzmán-Ponce et al. Table 4 Comparison between DBIG-US and the other algorithms using 1-NN. Data set Baseline RUS NCL TL ENN OSS BC RBt EEKF SBC CBU fCBUS CBIS sum yeast05679v4 + + – + + + + + + + + – + 11 vowel0 – + – – – – + + + + + – – 6 glass016v2 + + + + + + + + + + + + + 13 glass2 + + + + + + + + + + + + + 13 shuttle0v4 = ====–= = –= = +=1 yeast1v7 + + + + + + + + + + + + + 13 glass4 + + + + + + + + + + + + + 13 ecoli4 + – + + + + – + + + + – + 10 pagBks13v4 – – – – – – + + + – + – – 4 glass016v5 + + – + – + =+ + + + – – 8 shuttle2vs4 = ====––––=+ – – 1 yeast1458vs7 + + + + + + + + + + + + + 13 glass5 + =++++++– ++– +10 yeast2vs8 + + + + + + + + + + + + + 13 flareF + + + + + + + + + + + + + 13 yeast4 + + + + + + + + + + + + + 13 yeast1289v7 + + + + + + + + + + + + + 13 yeast5 + – – + – – – – – + – – + 4 ecoli0137v26 – – – – – – – – – – – – – 0 abalone17v78910 + + + + + + + + + + + + + 13 yeast6 + + – + + + + + – + + + + 11 shuttle2v5 =+=====+ + = = = = 3 kddBfOfw – – – – – – – – – – – – – 0 poker89v5 + + + + + + + + + + + + + 13 W/T/L 17/3/4 16/3/5 13/3/8 17/3/4 15/3/6 16/1/7 16/3/5 19/1/4 17/0/7 18/3/3 19/2/3 13/1/10 16/2/6 Table 5 Comparison between DBIG-US and the other algorithms using C4.5. Data set Baseline RUS NCL TL ENN OSS BC RBt EEKF SBC CBU fCBUS CBIS sum yeast05679v4 + + + + + + + – + + – – + 9 vowel0 – + + – – – + + + + + + + 9 glass016v2 + + + + + + + + + + – + + 12 glass2 + – + + + + + + + + – + + 11 shuttle0v4 = = +====+=+ + + =5 yeast1v7 + – + – + + – – + + – – + 7 glass4 + + + + + + – + + + + + + 12 ecoli4 – – + – + – – – – + – – – 3 pagBks13v4 – – – – – – – – + – – – – 1 glass016v5 + + + + + + + + + + =+ + 12 shuttle2vs4 + =+++= = +=+=++8 yeast1458vs7 + + + + + + + + + + + + + 13 glass5 + =++++++=== ++9 yeast2vs8 + + + + + + + + + + – + + 12 flareF + + + + + + + + – + + + + 12 yeast4 + + + + + + + + + + + + + 13 yeast1289v7 + + + + + + + + + + + + + 13 yeast5 – – – – – – – – – – – – – 0 ecoli0137v26 – – – – – – – – – – – – – 0 abalone17v78910 + + + + + + + + + + + + + 13 yeast6 + + + + + + – + – + – + + 10 shuttle2v5 = =========+ + =2 kddBfOfw – =––––=–––+ ––1 poker89v5 + + + + + + + + + + + + + 13 W/T/L 16/2/6 13/5/6 19/1/4 15/2/7 17/2/5 15/3/6 13/4/7 16/1/7 14/4/6 18/2/4 11/3/10 17/0/7 17/2/5 than the method of the column, and the symbol ‘‘◦’’ means that the method of the column performed significantly better than the method of the row. The two bottom rows show how many times the algorithm of the column was significantly better than the remaining techniques. Results in Tables 8 and 9show that DBIG-US was statistically better than the other methods for both levels of significance when the 1-NN classifier was used. However, when the C4.5 tree was applied, CBU was the best method for 𝛼= 0.95 and, statistically equal than DBIG-US for 𝛼= 0.90. Finally, analyzing both methods (DBIG-US and CBU) we can see that there are not statistical differences in both levels of significance (see Table 9). These results indicate that DBIG-US is a competitive proposal to face the class imbalance problem. On the other hand, the ensemble-based methods were among the top-5 under-sampling algorithms with the C4.5 classifier, which suggests that splitting the majority class into several subsets and training an ensemble may give rise to significantly better performance than the neighborhood-based under-sampling algorithms (NCL, TL, ENN, and OSS). 5.3. Rebalancing performance A second question of interest to the present study is the rebalancing performance of the resampling algorithms, that is, their capability to produce an equal or similar number of instances in both classes. This will allow to gain further understanding of how the removal of majority class instances affects the classification performance. Here the rebalancing performance was evaluated using the imbalance ratio of the sets produced by the application of the under-sampling methods. Table 10 provides the imbalance ratio of each under-sampled data set. Initially, the imbalance ratio of the 24 data sets was between 9.35 and 82 (see Table 1). After running the under-sampling algorithms
Expert Systems With Applications xxx (xxxx) xxx 8 A. Guzmán-Ponce et al. Table 6 Holm’s post hoc test (𝛼= 0.05) for the 1NN classifier. Algorithm 𝑧= (𝑅0−𝑅𝑖)∕𝑆𝐸 𝑝 Holm 13 Baseline 5.05473 0 0.003846 12 TL 4.192148 0.000028 0.004167 11 CBU 3.829864 0.000128 0.004545 10 OSS 3.502083 0.000462 0.005 9 SBC 3.15705 0.001594 0.005556 8 CBIS 2.622249 0.008735 0.00625 7 RUS 2.449733 0.014296 0.007143 6 BC 2.415229 0.015725 0.008333 5 RBt 1.966687 0.049219 0.01 4 ENN 1.587151 0.112478 0.0125 3 EEKF 1.345628 0.178423 0.016667 2 NCL 0.897085 0.369673 0.025 1 fCBUS 0.793575 0.427443 0.05 Table 7 Holm’s post hoc test (𝛼= 0.05) for the C4.5 classifier. Algorithm 𝑧= (𝑅0−𝑅𝑖)∕𝑆𝐸 𝑝 Holm 13 OSS 4.123142 0.000037 0.003846 12 Baseline 3.864367 0.000111 0.004167 11 SBC 3.674599 0.000238 0.004545 10 TL 3.622844 0.000291 0.005 9 NCL 2.932779 0.003359 0.005556 8 ENN 2.363475 0.018104 0.00625 7 fCBUS 2.225461 0.02605 0.007143 6 BC 1.673409 0.094247 0.008333 5 CBIS 1.587151 0.112478 0.01 4 RUS 1.569899 0.116439 0.0125 3 RBt 1.500893 0.133383 0.016667 2 EEKF 0.534801 0.592788 0.025 1 DBIG-US 0.034503 0.972476 0.05 enumerated in Section 4, the imbalance ratio decreased considerably (it was equal or close to 1.0) when RUS, BC, EE-KF, Fast-CBUS, CBIS and DBIG-US were used. Conversely, most data sets that were resampled by NCL, TL, ENN and OSS were still heavily class-imbalanced, thus leading to low rebalancing performance. For instance, taking a look at the results over the poker89v5 database, RUS and DBIG-US yielded an imbalance ratio equal to 1.00, while the imbalance ratios produced by the use of NCL, TL, ENN and OSS (79.4, 81.7, 80.5 and 80.6, respectively) were very similar to that of the original data set. Another way to assess the rebalancing performance is to calculate the reduction percentage in the imbalance ratio. Results reveal that the top-2 under-sampling methods were RUS with an average reduction of 95.1% and the proposed DBIG-US algorithm with an average reduction of 94.2%. On the other hand, the average reductions achieved with NCL, TL, ENN and OSS were extremely low (7.5%, 2.6%, 6.8% and 35.1%, respectively), which corroborates the previous discussion of the results given in Table 10. 5.4. Classification performance vs rebalancing performance As already remarked in Section 1, the behavior of standard learning models has shown a significant loss of performance when the class imbalance is presented. In fact, various studies (López et al.,2013; Thabtah et al.,2020;Zhu et al.,2020a) reveal that the relationship between the imbalance ratio and the classifier performance is tight, suggesting that a skewed class distribution could degrade the performance of standard learners. In general, when there is no class imbalance in a data set, the performance of the classifier is uniform, stable and acceptable, but this is not the case when the imbalance ratio is moderate or severe. This is the reason why we analyzed the imbalance ratio in conjunction with the geometric mean, with the aim of investigating the effect of the final imbalance ratio on the classifier performance. To gain a better understanding of the behavior of each undersampling, Fig. 3 displays all the algorithms in the space spanned by the average geometric mean on the 𝑥-axis and the reduction in the imbalance ratio on the 𝑦-axis. A method with perfect performance will be located on the upper right corner (100% geometric mean, 100% reduction in IR) of the plot. The closer the method is to the upper right corner, the better its behavior. In summary, the following conclusions can be drawn from the combined analysis of classification performance and rebalancing performance: •The proposed DBIG-US, CBU, Fast-CBUS and the three ensemblebased methods are the techniques located closest to the upper right corner of the plots, which means that these yielded the best classification and rebalancing performances. •Taking into account both classifiers, DBIG-US obtained the best classification performance in terms of geometric mean and reduction in imbalance ratio. •The neighborhood-based algorithms together with SBC and CBIS showed low performance in both classification and rebalancing the classes. 6. Conclusions and future research This paper presents a novel under-sampling method (called DBIGUS) that combines the DBSCAN clustering algorithm for filtering the data set and a strategy based on a weighted graph to reduce the size of the majority class. This proposal takes advantage of the capability of DBSCAN for detecting and removing noisy instances, thus increasing the quality of the training set and obtaining a representative data set in which the classes were balanced. Another substantial issue is that the complexity of the proposed algorithm in the worst-case is (𝑛2). The behavior of the under-sampling techniques used in the experiments has been analyzed with the geometric mean of the accuracy on Table 8 Summary of the Wilcoxon’s test when using the 1-NN classifier. Baseline RUS NCL TL ENN OSS BC RBt EEKF SBC CBU fCBUS CBIS DBIG-US Base line – ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ RUS ∙–∙◦ NCL ∙–∙ ∙ ∙ ∙ ∙ ◦ TL ∙◦ ◦ –◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ENN ∙ ∙ –∙ ∙ ∙ ◦ ◦ OSS ∙◦ ◦ –◦ ◦ ◦ ◦ ◦ BC ∙ ∙ ∙ –◦ RBt ∙ ∙ ∙ –∙ ∙ ◦ EEKF ∙ ∙ ∙ –∙ ∙ ∙ ◦ SBC ∙◦∙◦ ◦ –◦ ◦ CBU ◦ ◦ ◦ –◦ ◦ fCBUS ∙ ∙ ∙ ∙ ∙ –∙ CBIS ∙ ∙ ◦–◦ DBIG-US ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ – 𝛼= 0.90 0 2 6 1 5 1 3 5 6 2 0 7 2 12 𝛼= 0.95 0 2 5 1 4 1 3 4 5 2 0 6 2 12