# A Cost-Sensitive Sparse Representation Based Classification for Class-Imbalance Problem

Authors: Zhenbing Liu; Chunyang Gao; Huihua Yang; Qijia He
Journal: Scientific Programming
 (2016)

---

## Abstract

Sparse representation has been successfully used in pattern recognition and machine learning. However, most existing sparse representation based classification (SRC) methods are to achieve the highest classification accuracy, assuming the same losses for different misclassifications. This assumption, however, may not hold in many practical applications as different types of misclassification could lead to different losses. In real-world application, much data sets are imbalanced of the class distribution. To address these problems, we propose a cost-sensitive sparse representation based classification (CSSRC) for class-imbalance problem method by using probabilistic modeling. Unlike traditional SRC methods, we predict the class label of test samples by minimizing the misclassification losses, which are obtained via computing the posterior probabilities. Experimental results on the UCI databases validate the efficacy of the proposed approach on average misclassification cost, positive class misclassification rate, and negative class misclassification rate. In addition, we sampled test samples and training samples with different imbalance ratio and useF-measure, G-mean, classification accuracy, and running time to evaluate the performance of the proposed method. The experiments show that our proposed method performs competitively compared to SRC, CSSVM, and CS4VM.


---

## Body

## 1. Introduction

As a powerful tool for statistical signal modeling, sparse representation (or sparse coding) has been successfully used in pattern recognition fields [1], such as texture classification [2] and face recognition [3, 4], in the past few years. In [3], John et al. proposed a sparse representation based classification (SRC) method when they solve the face recognition under various illuminations and occlusions, which represents an input test image as a sparse linear combination of training images and assigned the test image to the class whose training samples can best reconstruct it. In theirs work, they used L
1-regularizer rather than L
0-regularizer to regularize the objective function and then calculated the residuals between the original test sample and the reconstructed one to identify the query image’s label. Such a sparse representation based classification framework has achieved a great success in face recognition and has boosted the research of sparsity related machine learning methods.Traditional classification algorithms [5], including SRC, are designed to achieve the lowest recognition errors and assume the same losses for different types of misclassifications. However, this assumption may not be suitable for many real-world applications. For example, it may cause inconvenience to a gallery who is misclassified as an impostor and not allowed to enter the room controlled by a face recognition system but may result in a serious loss if an impostor is misclassified as a gallery and allowed entering the room. In such settings, the loss of misclassification should be taken into consideration, and “cost” information can be introduced to measure the severity of misclassification. In recent years, many cost-sensitive methods have been proposed. The typical works include the Cost-Sensitive Semisupervised Support Vector Machine (CS4VM) and Cost-Sensitive Laplacian Support Vector Machines (CSLSVM) proposed by Zhou et al. [6, 7], a cost-sensitive Naïve Bayes method from a novel perspective of inferring the order relation [8] proposed by Fang et al., and novel cost-sensitive approach proposed by Castro and Braga to improve the performance of multilayer perceptron [9]. In [10], an instance weighting method was incorporated into various Bayesian network classifiers. The probability estimation of Bayesian network classifiers was modified by the instance weighting method, which made Bayesian network classifiers cost-sensitive. In [11], Lo et al. presented a basis expansions model for multilabel classification to handle the cost-sensitive multilabel classification problem, where a basis function is an LP classifier trained on a random k-label set. In [12], Wan et al. proposed a cost-sensitive feature selection method called Discriminative Cost-Sensitive Laplacian Score (DCSLS) for face recognition, which incorporated the idea of local discriminant analysis into Laplacian Score.Cost-sensitive learning always coexists with class-imbalance in most applications with the goal of minimizing the total misclassification cost [13]. Class-imbalance has been considered as one of the most challenging problems in machine learning and data mining. The ratio of imbalance (the size of majority class to minority class) can be as huge as 100, even up to 10000. Much work has been done in addressing the class-imbalance problem. Cost-sensitive learning is an effective method to deal with the imbalance data classification problem. In recent year, cost-sensitive learning has been studied widely and become one of the most important topics for solving the class-imbalance problem. In [14], Zhou and Liu studied empirically the effect of sampling and threshold-moving in training cost-sensitive neural networks and revealed that threshold-moving and soft-ensemble are relatively good choices in training cost-sensitive neural networks. There are also some other cost-sensitive learning methods by improving the existed method. In [15], Sun et al. proposed a cost-sensitive boosting algorithms, which are developed by introducing cost items into the learning framework of AdaBoost. Another strategy for class-imbalance problem is based on exchanging the distribution of data sets. In [16], Jiang et al. proposed a novel Minority Cloning Technique (MCT) for class-imbalanced cost-sensitive learning. MCT alters the class distribution of training data by cloning each minority class instance according to the similarity between it and the mode of the minority class. Generally, users focus more on the minority class and consider the cost of misclassifying a minority class to be more expensive. In our study, we adopt the same strategy to address this problem.In [17], a probabilistic cost-sensitive classifier was proposed for face recognition; they utilize the probabilistic model to estimate the posterior probability of a testing sample and calculate all the misclassification losses via the posterior probabilities. Motivated by this probabilistic model and probabilistic subspace clustering [17–19], we proposed a new method to handle misclassification cost. In sparse representation, it will play an important role for reconstruction if the value of coefficient is higher [20]. In other words, the coefficient is 1 when a query sample was represented by a dictionary with the same sample as the query one. Just like Gaussian distribution, a sample that is close to the mean vector has a higher probability. Inspired by probabilistic model, we use coefficient matrix to calculate the posterior probabilities rather than the distribution of noise (residual) in [17] and they have to estimate the distribution of noise. The main advantage of our method is to reduce the computation complexity and computation cost, and the contribution of the proposed method is obtaining the posterior probability by coefficient vector of sparse representation. After calculating all the misclassification losses via the posterior probabilities, the test sample is assigned to the class whose loss is minimal. Experimental results on UCI databases validate the effectiveness and efficiency of our methods.This paper is organized as follows. Section2 outlines the details of the relevant method. Section 3 presents the details of the proposed algorithm. Section 4 reports the experiments. Finally, Section 5 concludes the paper and offers suggestions for future research.


## 2. Related Works

In this section, we briefly introduce some related works, including sparse representation based classification and cost-sensitive learning framework.


### 2.1. Sparse Representation Based Classification

Sparse representation is a typically method in machine learning [3, 21, 22], which is to use labeled training samples from k distinct object classes to learn a dictionary and determine the label of an unseen new test sample correctly. We denote the data set with k
i training samples from the ith class as a matrix A
i
=
[
v
i
,
1
,
v
i
,
2
,
…
,
v
i
,
n
i
]
∈
R
m
×
k
i and n
=
∑
i
=
1
k
k
i is the number of all training samples, where k is the number of classes in training set. Given sufficient training samples of the ith class, any test sample y
∈
R
m from the same class will be approximately represented linearly by the training samples of class i: (1)
y
=
x
i
,
1
v
i
,
1
+
x
i
,
2
v
i
,
2
+
⋯
+
x
i
,
k
i
v
i
,
k
i
.Then, rewrite the above representation of y in matrix form as y
=
A
i
x
i, where x
i
=
[
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
]
∈
R
k
i. Then, define a new matrix A for the entire training set as follows:(2)
A
=
A
1
,
A
2
,
…
,
A
k
=
v
1,1
,
v
1,2
,
…
,
v
1
,
n
i
,
…
,
v
i
,
1
,
…
,
v
i
,
n
i
,
…
,
v
k
,
1
,
…
,
v
k
,
n
k
∈
R
m
×
n
.Many method based distances are not robust in real-world applications because of various occlusions. To overcome this limitations, Wright introduced the sparse representation based classification method to represent the query image. Then, the linear representation of y can be rewritten in terms of all training samples as(3)
y
=
A
x
0
,where x
0
=
[
0
,
…
,
0
,
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
,
0
,
…
,
0
]
T
∈
R
n, whose entries are zero except those associated with the ith class. This motivates us to seek the sparsest solution by solving the following optimization problem: (4)
x
^
0
=
a
r
g
m
i
n
x
0
s.t.
A
x
=
y
,where ·
0 denotes the L
0-norm, which counts the number of nonzero entries in a vector. However, the above problem of finding the sparsest solution (L
0-norm minimization problem) is nonconvex and actually NP-hard. Generally, if the solution sought is sparse enough, the solution of the L
0-minimization problem is equal to the solution of the following L
1-minimization problem [4, 22, 23]: (5)
x
^
1
=
a
r
g
m
i
n
x
1
s.t.
A
x
=
y
.The real data are noisy; it may not represent the test sample exactly. To deal with the noises, John et al. extended the L
1-norm minimization problem to the following formulation:(6)
y
=
A
x
0
+
z
,where z is a noise term with bounded energy z
2
<
ε. The sparse solution x
0 can still be obtained by solving the following stable L
1-minimization problem:(7)
x
^
1
=
a
r
g
m
i
n
x
1
s.t.
y
-
A
x
2
≤
ε
.To better harness such linear structure, they instead classify y based on how well the coefficients associated with all training samples of each object reproduce y. Let x
^ be the solution of (7), for each class i, let δ
i be the characteristic function that selects the coefficients associated with the ith class. Using the coefficients, one can approximate the given test sample y as y
^
i
=
A
δ
i
(
x
^
), where δ
i
(
x
^
)
=
[
0
,
…
,
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
,
…
,
0
]
T. They then compute the residual (Euclidean distance) r
i
(
y
) between y and y
^:(8)
r
i
y
=
y
-
A
δ
i
x
^
2
.The label of the test sample y can be identified by minimizing r
i
(
y
) as follows:(9)
L
y
=
arg
⁡
min
i
⁡
r
i
y
.


### 2.2. Cost-Sensitive Function

In multiclass cost-sensitive learning, consideringc gallery subjects with their class labels G
=
{
G
i
}
i
=
1,2
,
…
,
c, many impostors, whose labels are I. In [7], Zhang and Zhou categorized the costs into three types: cost of false acceptance C
I
G, cost of false rejection C
G
I, and cost of false identification C
G
G. Empirically, it is evident that C
I
G, C
G
I, and C
G
G are unequal. Give a cost setting according to the users and reassign C
I
G
=
C
I
G
/
C
G
G, C
G
I
=
C
G
I
/
C
G
G, and C
G
G
=
1. Here, for the ease of understanding, we still preserve the original formulation. We can construct a multiclass cost matrix C as shown in (10)
G
1
⋯
G
M
I
G
1
0
⋯
C
G
G
C
G
I
⋮
⋮
0
⋮
⋮
G
M
C
G
G
⋯
0
C
G
I
I
C
I
G
⋯
C
I
G
0where C
i
j indicates the cost of misclassifying a sample of the ith class as the jth class. The diagonal elements of C are all zero since there is no loss for correct recognition.Cost-sensitive learning usually sets the misclassification cost as objective function and identifies the label by minimizing loss function. Given a test sampley and its predicted class label as ϕ
(
y
), respectively, the label is obtained by minimizing the objective function:(11)
L
y
=
arg
min
ϕ
y
∈
G
1
,
…
,
G
c
,
I
⁡
l
o
s
s
y
,
ϕ
y
,where(12)
l
o
s
s
y
,
ϕ
y
=
∑
i
=
1
c
P
G
i
∣
y
C
G
I
if
ϕ
y
=
I
∑
i
=
1
i
≠
τ
c
P
G
i
∣
y
C
G
G
+
P
I
∣
y
C
I
G
,
if
ϕ
y
=
G
τ
,where ϕ
^
(
y
) is the optimal prediction of y and c represents the gallery subjects in classification problem.


## 2.1. Sparse Representation Based Classification

Sparse representation is a typically method in machine learning [3, 21, 22], which is to use labeled training samples from k distinct object classes to learn a dictionary and determine the label of an unseen new test sample correctly. We denote the data set with k
i training samples from the ith class as a matrix A
i
=
[
v
i
,
1
,
v
i
,
2
,
…
,
v
i
,
n
i
]
∈
R
m
×
k
i and n
=
∑
i
=
1
k
k
i is the number of all training samples, where k is the number of classes in training set. Given sufficient training samples of the ith class, any test sample y
∈
R
m from the same class will be approximately represented linearly by the training samples of class i: (1)
y
=
x
i
,
1
v
i
,
1
+
x
i
,
2
v
i
,
2
+
⋯
+
x
i
,
k
i
v
i
,
k
i
.Then, rewrite the above representation of y in matrix form as y
=
A
i
x
i, where x
i
=
[
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
]
∈
R
k
i. Then, define a new matrix A for the entire training set as follows:(2)
A
=
A
1
,
A
2
,
…
,
A
k
=
v
1,1
,
v
1,2
,
…
,
v
1
,
n
i
,
…
,
v
i
,
1
,
…
,
v
i
,
n
i
,
…
,
v
k
,
1
,
…
,
v
k
,
n
k
∈
R
m
×
n
.Many method based distances are not robust in real-world applications because of various occlusions. To overcome this limitations, Wright introduced the sparse representation based classification method to represent the query image. Then, the linear representation of y can be rewritten in terms of all training samples as(3)
y
=
A
x
0
,where x
0
=
[
0
,
…
,
0
,
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
,
0
,
…
,
0
]
T
∈
R
n, whose entries are zero except those associated with the ith class. This motivates us to seek the sparsest solution by solving the following optimization problem: (4)
x
^
0
=
a
r
g
m
i
n
x
0
s.t.
A
x
=
y
,where ·
0 denotes the L
0-norm, which counts the number of nonzero entries in a vector. However, the above problem of finding the sparsest solution (L
0-norm minimization problem) is nonconvex and actually NP-hard. Generally, if the solution sought is sparse enough, the solution of the L
0-minimization problem is equal to the solution of the following L
1-minimization problem [4, 22, 23]: (5)
x
^
1
=
a
r
g
m
i
n
x
1
s.t.
A
x
=
y
.The real data are noisy; it may not represent the test sample exactly. To deal with the noises, John et al. extended the L
1-norm minimization problem to the following formulation:(6)
y
=
A
x
0
+
z
,where z is a noise term with bounded energy z
2
<
ε. The sparse solution x
0 can still be obtained by solving the following stable L
1-minimization problem:(7)
x
^
1
=
a
r
g
m
i
n
x
1
s.t.
y
-
A
x
2
≤
ε
.To better harness such linear structure, they instead classify y based on how well the coefficients associated with all training samples of each object reproduce y. Let x
^ be the solution of (7), for each class i, let δ
i be the characteristic function that selects the coefficients associated with the ith class. Using the coefficients, one can approximate the given test sample y as y
^
i
=
A
δ
i
(
x
^
), where δ
i
(
x
^
)
=
[
0
,
…
,
x
i
,
1
,
x
i
,
2
,
…
,
x
i
,
k
i
,
…
,
0
]
T. They then compute the residual (Euclidean distance) r
i
(
y
) between y and y
^:(8)
r
i
y
=
y
-
A
δ
i
x
^
2
.The label of the test sample y can be identified by minimizing r
i
(
y
) as follows:(9)
L
y
=
arg
⁡
min
i
⁡
r
i
y
.


## 2.2. Cost-Sensitive Function

In multiclass cost-sensitive learning, consideringc gallery subjects with their class labels G
=
{
G
i
}
i
=
1,2
,
…
,
c, many impostors, whose labels are I. In [7], Zhang and Zhou categorized the costs into three types: cost of false acceptance C
I
G, cost of false rejection C
G
I, and cost of false identification C
G
G. Empirically, it is evident that C
I
G, C
G
I, and C
G
G are unequal. Give a cost setting according to the users and reassign C
I
G
=
C
I
G
/
C
G
G, C
G
I
=
C
G
I
/
C
G
G, and C
G
G
=
1. Here, for the ease of understanding, we still preserve the original formulation. We can construct a multiclass cost matrix C as shown in (10)
G
1
⋯
G
M
I
G
1
0
⋯
C
G
G
C
G
I
⋮
⋮
0
⋮
⋮
G
M
C
G
G
⋯
0
C
G
I
I
C
I
G
⋯
C
I
G
0where C
i
j indicates the cost of misclassifying a sample of the ith class as the jth class. The diagonal elements of C are all zero since there is no loss for correct recognition.Cost-sensitive learning usually sets the misclassification cost as objective function and identifies the label by minimizing loss function. Given a test sampley and its predicted class label as ϕ
(
y
), respectively, the label is obtained by minimizing the objective function:(11)
L
y
=
arg
min
ϕ
y
∈
G
1
,
…
,
G
c
,
I
⁡
l
o
s
s
y
,
ϕ
y
,where(12)
l
o
s
s
y
,
ϕ
y
=
∑
i
=
1
c
P
G
i
∣
y
C
G
I
if
ϕ
y
=
I
∑
i
=
1
i
≠
τ
c
P
G
i
∣
y
C
G
G
+
P
I
∣
y
C
I
G
,
if
ϕ
y
=
G
τ
,where ϕ
^
(
y
) is the optimal prediction of y and c represents the gallery subjects in classification problem.


## 3. Cost-Sensitive SRC

In [5], Alpaydın calculated the residuals to identify the class label of a test sample y, which is the Euclidean distance between reconstructed sample and the original test sample y. In cost-sensitive learning, the loss function (see (7)) is regarded as an objective function to identify the label of a test sample. In binary classification problem, there are two misclassification costs, and we denote the cost that misclassifies positive class as negative class by C
10 and the cost by C
01 conversely. Then a cost matrix can be constructed as shown in (13)
G
0
G
1
G
0
0
C
01
G
1
C
10
0where G
1 and G
0 represents the label of minority class and majority class, respectively.It is well known that the loss function can be related to the posterior probabilityP
(
ϕ
(
y
)
∣
y
)
≈
P
(
δ
i
(
x
i
)
∣
y
). Then the loss function can be rewritten as follows: (14)
loss
y
,
ϕ
y
=
∑
i
=
G
1
P
δ
i
∣
y
C
10
if
ϕ
y
=
G
0
∑
j
=
G
0
P
δ
j
∣
y
C
01
if
ϕ
y
=
G
1
.The test sample y belongs to the class with higher probability. Now, we will estimate P
(
δ
i
(
x
)
∣
y
), (
i
=
0,1
).In coefficient matrix, the larger the element value is, the more important the role it will play for reconstructing a test sample. In other words, it is best to represent the test sample by training samples and they have the same class label, and there are no samples from different class in this linear combination. The posterior probability can be related to the coefficient matrix. Accordingly, we rewrite the solution of (7) as x
^
=
[
x
+
x
-
]
T, where x
+
=
[
x
1
+
,
x
2
+
,
…
,
x
n
+
+
]
∈
R
n
+ and x
-
=
[
x
1
-
,
x
2
-
,
…
,
x
n
-
-
]
∈
R
n
- represent the positive class coefficient and negative class coefficient, respectively. Here, n
+ is the number of positive samples and n
- is the number of negative samples in dictionary. Then, we can obtain the posterior probabilities:(15)
P
δ
i
∣
y
=
∑
i
=
1
n
+
x
i
+
X
if
i
=
G
1
,
P
δ
j
∣
y
=
∑
j
=
1
n
-
x
j
-
X
if
j
=
G
0
,where X
=
∑
j
=
1
n
-
x
j
-
+
∑
i
=
1
n
+
x
i
+. Then, (14) can be written as(16)
l
o
s
s
y
,
ϕ
y
=
∑
i
=
1
n
+
x
i
+
X
C
10
if
ϕ
y
=
G
1
∑
j
=
1
n
-
x
j
-
X
C
01
if
ϕ
y
=
G
0
.We can obtain the label of a test sample y by minimizing (16):(17)
L
y
=
a
r
g
min
i
∈
0,1
⁡
l
o
s
s
y
,
ϕ
y
.The whole process of CSSRC is described in Algorithm 1.Algorithm 1 (CSSRC algorithm).
Input. Dictionary A
∈
R
m
×
n, test sample y
∈
R
m
Output. The label L
(
y
) of test sample y
(1)
Normalize the columns ofA to unit L
2-norm
(2)
Solve theL
1-minimization problem:(18)
x
^
=
a
r
g
m
i
n
x
1
s.t.
y
=
A
x
Or alternatively, solve(19)
x
^
=
a
r
g
m
i
n
x
1
s.t.
A
x
-
y
2
≤
ε
Assume the solution isx
^
=
[
x
+
x
-
]
T
(3)
Calculate the loss function:(20)
l
o
s
s
y
,
ϕ
y
=
∑
i
=
1
n
+
x
i
+
X
C
10
if
ϕ
y
=
G
1
∑
j
=
1
n
-
x
j
-
X
C
01
if
ϕ
y
=
G
0
,
whereX
=
∑
j
=
1
n
-
x
j
-
+
∑
i
=
1
n
+
x
i
+
(4)
Obtain the label ofy:(21)
L
y
=
a
r
g
min
i
∈
0,1
⁡
l
o
s
s
y
,
ϕ
y
.


## 4. Experiments

### 4.1. Data Sets and Experimental Setting

We test the proposed method on seven UCI data sets [24]. Detailed information about these data sets is summarized in Table 1.Table 1
Description of data sets.
Dataset
Size
Target
Ratio
min/maj
Abalone
4117
Ring = 7
9.7
391/3786
Housing
506
[20, 23]
3.8
106/400
Nursery
12960
Very-recom
38.5
328/12632
Letter
20000
A
24.3
789/19211
Pima
786
Class 1
1.7
268/500
Cmc
1473
Class 2
3.4
333/1344
Car
1728
acc
3.5
384/1344In cost-sensitive learning, false positive (actual negative but predicted as positive, denoted as FP), false negative (actual positive but predicted as negative, FN), true positive (actual positive and predicted as positive, TP), and true negative (actual negative and predicted as negative, TN) can be given in a confusion matrix as follows:(22)
Positive Class
Negative Class
Positive Class
T
P
F
N
Negative Class
F
P
T
NTo binary classification problems, four kinds of misclassification cost are needed, which is referred to as CTP, CFP, CTN, and CFN, respectively. CTP and CTN are the costs of true positive (TP) and true negative (TN). In order to simplify the cost matrix, we set CTP = 0 and CTN = 0. CFN and CFP are the costs of false negative (FN) and false positive (FP). We always assume that the cost of misclassifying positive class instances is much higher than the cost of misclassifying negative class instances, so we set CFN ≫ CFP. In this paper, CFP is set to be a unit cost of 1; CFN is assigned different values:5,10,15
,
…
,
50, respectively. In our experiments, we adopt 10-folder cross-validation to get the average cost, and three evaluation criteria are adopted to evaluate the classification performance in cost-sensitive experiments: average cost (AC), error rate of false acceptance (Err(IG)), and error rate of false rejection (Err(GI)). For class-imbalance problem, we choose F-measure and G-mean to evaluate the performance. They are defined as follows [25, 26]:(23)
A
C
=
C
10
F
P
+
C
01
F
N
N
,
E
r
r
G
I
=
F
P
N
+
,
Err
I
G
=
FN
N
-
,
Recall
=
Acc
+
=
TP
TP
+
FN
,
Acc
-
=
TN
TN
+
FP
,
Accuracy
=
Acc
-
+
Acc
+
,
Precision
=
TP
TP
+
FP
,
G
-mean
=
Acc
+
×
Acc
-
,
F
-measure
=
2
×
Precision
×
Recall
Precision
+
Recall
,where F
P and F
N represent the number of false acceptances and false rejections, respectively. N, N
+, and N
- represent the number of test samples, positive class samples, and negative class samples, and N
=
N
+
+
N
-.In order to illustrate the performance of CSSRC, sparse representation based classification (SRC), Cost-Sensitive Support Vector Machine (CSSVM), and Cost-Sensitive Semisupervised Support Vector Machine (CS4VM) are chosen to compare the performance on three experiments. The experiments are performed on Matlab 2014a and the computer with a 2.6 GHz Intel Xeon CPU.


### 4.2. The Effect of Cost for SRC

For data set Housing, the size is smaller than the other six data sets, so less samples are selected for train set and test set. We select 31 positive samples and 31 negative samples randomly from Housing as test samples and 41 positive samples and 41 negative samples as training samples. We select 61 positive samples and 61 negative samples as test samples from Abalone, Nursery, Letter, Pima, Cmc, and Car and 101 positive samples and 101 negative samples as training samples. We repeat sampling 100 times and get the average results.Experiment 1.
We compare the performance of these 4 methods (CSSRC, SRC, CSSVM, and CS4VM) on Abalone, Nursery, Letter, Pima, Cmc, Housing, and Car. We set cost ratio (the cost of false acceptance respect to false rejection) as 10, and the results are summarized in (22). From Table 2, we can see that the proposed cost-sensitive approach achieves lower average misclassification cost than the other three methods on Abalone, Nursery, Letter, Pima, Housing, and Car except Cmc. CSSRC’s average cost is higher than CS4VM but lower than the other two methods on Cmc and lower than CS4VM on the other 6 data sets. The average cost of CSSRC is 0.5122 and CS4VM’s average cost is 0.5105. They are in the same order of magnitudes. In other words, our method has better performance than SRC, CSSVM, and CS4VM.Table 2
Average cost of the four methods (cost ratio 1 : 10).
Methods
CSSRC
SRC
CSSVM
CS4VM
Abalone
0.0122
0.6585
1.5905
0.4590
Housing
0.0610
0.1585
1.6333
0.4190
Nursery
0.0488
0.3902
0.3110
0.0817
Letter
0.1220
0.6219
0.1774
0.3378
Pima
0.0122
2.4390
2.4495
0.5027
Cmc
0.5122
0.5488
1.9905
0.5105
Car
0.0244
0.0976
0.6714
0.2610Experiment 2.
According to the results in Experiment1, we plot two pictures from Figure 1. For either positive class or negative class, the proposed method can achieve a lower error rate on Nursery and Abalone when the cost ratio ranges from 5 to 50. Although CS4VM can obtain a lower error rate of false rejection, its error rate of false acceptance is very high, this can generate a serious total cost. From Figure 1, we can easily find that our method can achieve lower error rate of false rejection and lower error rate of false acceptance simultaneously.Figure 1
Error rate of false acceptance and false rejection.
(a)
The result on Nursery
(b)
The result on AbaloneExperiment 3.
In this section, we set cost ratio from 10 to 50, and the results are summarized as Table3. The first row is coat ratios and the first two columns represent data sets and classification methods, respectively. In Experiment 2 we use merely two data sets, for proving the robust of our method; more data sets are adopted in this experiment. Our proposed cost-sensitive SRC achieved a lower average costs on four data sets. Although it is not the lowest cost on Nursery and Letter, it has the same order of magnitude as the lowest cost value.Table 3
Average cost of methods on five data sets with cost ratio from 10 to 50.
Cost ratio
10
15
20
25
30
35
40
45
50
Abalone
CSSRC
0.365
0.548
0.487
0.304
0.365
0.426
0.975
0.975
0.609
SRC
1.621
1.646
2.256
2.512
5.487
4.365
5.853
2.280
9.146
CS4VM
4.267
7.036
9.498
12.024
14.561
17.124
19.220
21.809
24.183
CSSVM
1.615
2.213
2.746
3.795
4.175
5.569
6.238
6.542
7.643
Nursery
CSSRC
0.365
0.365
0.731
0.304
0.365
0.426
0.975
0.548
1.829
SRC
4.268
6.585
6.341
6.500
12.804
11.536
13.670
19.207
22.560
CS4VM
0.670
1.001
1.416
1.764
2.108
2.700
2.753
3.152
3.733
CSSVM
0.348
0.394
0.691
0.836
0.895
1.204
1.204
1.531
1.613
Housing
CSSRC
0.487
0.365
0.000
0.000
0.000
0.426
0.000
0.000
0.000
SRC
2.439
2.561
1.256
6.707
5.853
8.109
6.341
12.073
12.195
CS4VM
3.765
6.007
8.091
10.046
11.975
13.491
15.878
17.793
19.420
CSSVM
1.689
2.544
3.106
4.326
4.983
5.228
6.703
6.265
7.647
Letter
CSSRC
0.024
0.049
0.024
0.036
0.012
0.061
0.036
0.085
0.037
SRC
0.036
0.049
0.025
0.305
0.036
0.024
0.049
0.049
1.244
CS4VM
0.606
1.150
1.146
1.483
1.891
2.282
2.405
2.760
3.983
CSSVM
0.158
0.277
0.388
0.298
0.409
0.319
0.466
0.757
0.798
Car
CSSRC
0.000
0.183
0.488
0.000
0.366
0.000
0.488
0.548
0.610
SRC
1.097
1.463
2.195
3.354
1.463
5.549
4.878
5.134
5.488
CS4VM
2.500
3.849
5.307
6.556
7.939
9.365
10.605
11.514
12.854
CSSVM
1.335
1.486
1.711
2.250
2.388
2.561
2.570
2.895
2.998The above there experiments have proved the effect of cost term for SRC. Particularly, the comparison of SRC and CSSRC can well validate the conclusion that the cost term can improve the performance of SRC.


### 4.3. Solving Class-Imbalance Problem

Experiment 1.
In this section we will solve the class-imbalance problem. Table1 has summarized the information of data sets we used, and the imbalance ratio higher 10 is Nursery and Letter. In order to set a higher imbalance ratio, we select Nursery in this experiment. Similarly, we compare the performance of these four methods (SRC, CSSVM, CS4VM, and CSSRC) on Nursery. It is difficult to reflect the performance of our method for class-imbalance problem, and F-measure, G-mean, and classification accuracy have been adopted for the class-imbalance problem. In this experiment, we take the imbalance ratio from [
1,2
,
…
,
10
], respectively. The size of minority class is 30 and the majority class is 30 multiplying the imbalance ratios in training set, accordingly. We select 61 positive samples and 61 negative samples as test set and run and summarize the results as in Figures 2 and 3; the sampling process has repeated 100 times and gets the average results.
Figure2 shows the results of F-measure on Nursery, and the definition of F-measure (the harmonic mean between the classification accuracy of positive class and the classification accuracy of negative class) has been shown in Section 4.1. It is obvious that our method has achieved a higher F-measure value with respect to sparse representation based classification, Cost-Sensitive Support Vector Machine, and Cost-Sensitive Semisupervised Support Vector Machine. Moreover, the method we proposed achieved a more stable performance with the increasing of imbalance ratio. Similarly, G-mean (the geometric mean between the classification accuracy of positive class and the classification accuracy of negative class) also achieved a higher value with respect the other three methods in Figure 3.
It is difficult to evaluate the performance of methods solving class-imbalance problem, but we use classification accuracy to reflect the method additionally for persuasive, and this is summarized in Table4. On the other hand, running time represents the computation cost of a method. The result is shown in Table 5. It is obvious that our method can get the highest classification accuracy and the lowest running time on Nursery. In this paper, we use sparse representation coefficient vectors to estimate the posterior probability; this can well reduce the computing complexity and computation cost.Table 4
Classification accuracy on Nursery.
Accuracy
1
2
3
4
5
6
7
8
9
10
SRC
0.9298
0.9305
0.9343
0.9412
0.9420
0.9460
0.9484
0.9484
0.9530
0.9572
CS4VM
0.9186
0.9256
0.9307
0.9345
0.9335
0.9414
0.9400
0.9396
0.9369
0.9421
CSSVM
0.9279
0.9398
0.9314
0.9393
0.9345
0.9319
0.9285
0.9279
0.9285
0.9294
CSSRC
0.9601
0.9623
0.9610
0.9585
0.9610
0.9600
0.9610
0.9627
0.9597
0.9616Table 5
Running time on Nursery.
Time/s
1
2
3
4
5
6
7
8
9
10
SRC
0.0105
0.0385
0.0664
0.0973
0.1324
0.1721
0.2158
0.2620
0.3137
0.3702
CS4VM
1.7131
1.7114
1.9854
2.0866
2.0969
2.2246
2.2572
2.3539
2.3044
2.4455
CSSVM
3.7136
8.5207
15.1722
23.3593
33.2055
45.8405
59.8414
74.8664
93.9153
115.6757
CSSRC
0.0102
0.0237
0.0408
0.0594
0.0818
0.1069
0.1328
0.1594
0.1907
0.2236Figure 2
The result ofF-measure on Nursery.Figure 3
The result ofG-mean on Nursery.Experiment 2.
In this experiment, we intend to validate the applicability of our method for class-imbalance problem. In Experiment1 we have tested the validity of our method when the class distribution of training samples is imbalance. Now, we will select some training samples to validate our method, where the distribution of training samples is imbalance. Table 1 has summarized the information of data sets we used, and the imbalance ratio of Letter is 24.3. In order to set a higher imbalance ratio, we select Letter in this experiment. Similarly, we compare the performance of these four methods (SRC, CSSVM, CS4VM, and CSSRC) on Nursery. In this experiment, we take the imbalance ratio from [
1,2
,
…
,
10
], respectively. The size of minority class is 30 and the majority class is 30 multiplying the imbalance ratios in training set, accordingly. We select 61 positive samples and 61 negative samples as test set and run and summarize the results as Figures 4 and 5; the sampling process has repeated 100 times and gets the average results.
Figure4 has shown the F-measure with imbalanced training samples; Figure 5 has shown the F-measure with imbalanced test samples. It is obvious that our method achieves a stable and higher result on Letter than the other three methods from Figures 4 and 5. Although sparse representation based classification has a similar result of F-measure with our method in Figure 5, the running time is higher than our method in Table 6. Much experiments has been done in this section, we have compared F-measure with the imbalanced distribution of training samples and testing samples and running time, we can easily make a conclusion that our method is better than the other three methods, and we can well resolve the class-imbalance problem.Table 6
Running time on Letter.
Time/s
1
2
3
4
5
6
7
8
9
10
SRC
0.0968
0.4103
0.6356
0.9178
1.2650
1.6695
2.1277
2.6364
3.3029
3.8405
CS4VM
2.0102
2.3504
2.6401
2.9405
3.2302
3.5415
3.8596
4.1482
5.4454
5.7497
CSSVM
7.5763
14.9397
22.1502
25.5690
37.0908
44.1674
51.6777
59.1158
66.6602
74.3515
CSSRC
0.0308
0.1170
0.1914
0.2806
0.3954
1.3279
1.4672
1.6153
1.7826
1.9640Figure 4
The result ofF-measure on Letter (the distribution of training samples is imbalanced).Figure 5
The result ofF-measure on Letter (the distribution of test samples is imbalanced).


## 4.1. Data Sets and Experimental Setting

We test the proposed method on seven UCI data sets [24]. Detailed information about these data sets is summarized in Table 1.Table 1
Description of data sets.
Dataset
Size
Target
Ratio
min/maj
Abalone
4117
Ring = 7
9.7
391/3786
Housing
506
[20, 23]
3.8
106/400
Nursery
12960
Very-recom
38.5
328/12632
Letter
20000
A
24.3
789/19211
Pima
786
Class 1
1.7
268/500
Cmc
1473
Class 2
3.4
333/1344
Car
1728
acc
3.5
384/1344In cost-sensitive learning, false positive (actual negative but predicted as positive, denoted as FP), false negative (actual positive but predicted as negative, FN), true positive (actual positive and predicted as positive, TP), and true negative (actual negative and predicted as negative, TN) can be given in a confusion matrix as follows:(22)
Positive Class
Negative Class
Positive Class
T
P
F
N
Negative Class
F
P
T
NTo binary classification problems, four kinds of misclassification cost are needed, which is referred to as CTP, CFP, CTN, and CFN, respectively. CTP and CTN are the costs of true positive (TP) and true negative (TN). In order to simplify the cost matrix, we set CTP = 0 and CTN = 0. CFN and CFP are the costs of false negative (FN) and false positive (FP). We always assume that the cost of misclassifying positive class instances is much higher than the cost of misclassifying negative class instances, so we set CFN ≫ CFP. In this paper, CFP is set to be a unit cost of 1; CFN is assigned different values:5,10,15
,
…
,
50, respectively. In our experiments, we adopt 10-folder cross-validation to get the average cost, and three evaluation criteria are adopted to evaluate the classification performance in cost-sensitive experiments: average cost (AC), error rate of false acceptance (Err(IG)), and error rate of false rejection (Err(GI)). For class-imbalance problem, we choose F-measure and G-mean to evaluate the performance. They are defined as follows [25, 26]:(23)
A
C
=
C
10
F
P
+
C
01
F
N
N
,
E
r
r
G
I
=
F
P
N
+
,
Err
I
G
=
FN
N
-
,
Recall
=
Acc
+
=
TP
TP
+
FN
,
Acc
-
=
TN
TN
+
FP
,
Accuracy
=
Acc
-
+
Acc
+
,
Precision
=
TP
TP
+
FP
,
G
-mean
=
Acc
+
×
Acc
-
,
F
-measure
=
2
×
Precision
×
Recall
Precision
+
Recall
,where F
P and F
N represent the number of false acceptances and false rejections, respectively. N, N
+, and N
- represent the number of test samples, positive class samples, and negative class samples, and N
=
N
+
+
N
-.In order to illustrate the performance of CSSRC, sparse representation based classification (SRC), Cost-Sensitive Support Vector Machine (CSSVM), and Cost-Sensitive Semisupervised Support Vector Machine (CS4VM) are chosen to compare the performance on three experiments. The experiments are performed on Matlab 2014a and the computer with a 2.6 GHz Intel Xeon CPU.


## 4.2. The Effect of Cost for SRC

For data set Housing, the size is smaller than the other six data sets, so less samples are selected for train set and test set. We select 31 positive samples and 31 negative samples randomly from Housing as test samples and 41 positive samples and 41 negative samples as training samples. We select 61 positive samples and 61 negative samples as test samples from Abalone, Nursery, Letter, Pima, Cmc, and Car and 101 positive samples and 101 negative samples as training samples. We repeat sampling 100 times and get the average results.Experiment 1.
We compare the performance of these 4 methods (CSSRC, SRC, CSSVM, and CS4VM) on Abalone, Nursery, Letter, Pima, Cmc, Housing, and Car. We set cost ratio (the cost of false acceptance respect to false rejection) as 10, and the results are summarized in (22). From Table 2, we can see that the proposed cost-sensitive approach achieves lower average misclassification cost than the other three methods on Abalone, Nursery, Letter, Pima, Housing, and Car except Cmc. CSSRC’s average cost is higher than CS4VM but lower than the other two methods on Cmc and lower than CS4VM on the other 6 data sets. The average cost of CSSRC is 0.5122 and CS4VM’s average cost is 0.5105. They are in the same order of magnitudes. In other words, our method has better performance than SRC, CSSVM, and CS4VM.Table 2
Average cost of the four methods (cost ratio 1 : 10).
Methods
CSSRC
SRC
CSSVM
CS4VM
Abalone
0.0122
0.6585
1.5905
0.4590
Housing
0.0610
0.1585
1.6333
0.4190
Nursery
0.0488
0.3902
0.3110
0.0817
Letter
0.1220
0.6219
0.1774
0.3378
Pima
0.0122
2.4390
2.4495
0.5027
Cmc
0.5122
0.5488
1.9905
0.5105
Car
0.0244
0.0976
0.6714
0.2610Experiment 2.
According to the results in Experiment1, we plot two pictures from Figure 1. For either positive class or negative class, the proposed method can achieve a lower error rate on Nursery and Abalone when the cost ratio ranges from 5 to 50. Although CS4VM can obtain a lower error rate of false rejection, its error rate of false acceptance is very high, this can generate a serious total cost. From Figure 1, we can easily find that our method can achieve lower error rate of false rejection and lower error rate of false acceptance simultaneously.Figure 1
Error rate of false acceptance and false rejection.
(a)
The result on Nursery
(b)
The result on AbaloneExperiment 3.
In this section, we set cost ratio from 10 to 50, and the results are summarized as Table3. The first row is coat ratios and the first two columns represent data sets and classification methods, respectively. In Experiment 2 we use merely two data sets, for proving the robust of our method; more data sets are adopted in this experiment. Our proposed cost-sensitive SRC achieved a lower average costs on four data sets. Although it is not the lowest cost on Nursery and Letter, it has the same order of magnitude as the lowest cost value.Table 3
Average cost of methods on five data sets with cost ratio from 10 to 50.
Cost ratio
10
15
20
25
30
35
40
45
50
Abalone
CSSRC
0.365
0.548
0.487
0.304
0.365
0.426
0.975
0.975
0.609
SRC
1.621
1.646
2.256
2.512
5.487
4.365
5.853
2.280
9.146
CS4VM
4.267
7.036
9.498
12.024
14.561
17.124
19.220
21.809
24.183
CSSVM
1.615
2.213
2.746
3.795
4.175
5.569
6.238
6.542
7.643
Nursery
CSSRC
0.365
0.365
0.731
0.304
0.365
0.426
0.975
0.548
1.829
SRC
4.268
6.585
6.341
6.500
12.804
11.536
13.670
19.207
22.560
CS4VM
0.670
1.001
1.416
1.764
2.108
2.700
2.753
3.152
3.733
CSSVM
0.348
0.394
0.691
0.836
0.895
1.204
1.204
1.531
1.613
Housing
CSSRC
0.487
0.365
0.000
0.000
0.000
0.426
0.000
0.000
0.000
SRC
2.439
2.561
1.256
6.707
5.853
8.109
6.341
12.073
12.195
CS4VM
3.765
6.007
8.091
10.046
11.975
13.491
15.878
17.793
19.420
CSSVM
1.689
2.544
3.106
4.326
4.983
5.228
6.703
6.265
7.647
Letter
CSSRC
0.024
0.049
0.024
0.036
0.012
0.061
0.036
0.085
0.037
SRC
0.036
0.049
0.025
0.305
0.036
0.024
0.049
0.049
1.244
CS4VM
0.606
1.150
1.146
1.483
1.891
2.282
2.405
2.760
3.983
CSSVM
0.158
0.277
0.388
0.298
0.409
0.319
0.466
0.757
0.798
Car
CSSRC
0.000
0.183
0.488
0.000
0.366
0.000
0.488
0.548
0.610
SRC
1.097
1.463
2.195
3.354
1.463
5.549
4.878
5.134
5.488
CS4VM
2.500
3.849
5.307
6.556
7.939
9.365
10.605
11.514
12.854
CSSVM
1.335
1.486
1.711
2.250
2.388
2.561
2.570
2.895
2.998The above there experiments have proved the effect of cost term for SRC. Particularly, the comparison of SRC and CSSRC can well validate the conclusion that the cost term can improve the performance of SRC.


## 4.3. Solving Class-Imbalance Problem

Experiment 1.
In this section we will solve the class-imbalance problem. Table1 has summarized the information of data sets we used, and the imbalance ratio higher 10 is Nursery and Letter. In order to set a higher imbalance ratio, we select Nursery in this experiment. Similarly, we compare the performance of these four methods (SRC, CSSVM, CS4VM, and CSSRC) on Nursery. It is difficult to reflect the performance of our method for class-imbalance problem, and F-measure, G-mean, and classification accuracy have been adopted for the class-imbalance problem. In this experiment, we take the imbalance ratio from [
1,2
,
…
,
10
], respectively. The size of minority class is 30 and the majority class is 30 multiplying the imbalance ratios in training set, accordingly. We select 61 positive samples and 61 negative samples as test set and run and summarize the results as in Figures 2 and 3; the sampling process has repeated 100 times and gets the average results.
Figure2 shows the results of F-measure on Nursery, and the definition of F-measure (the harmonic mean between the classification accuracy of positive class and the classification accuracy of negative class) has been shown in Section 4.1. It is obvious that our method has achieved a higher F-measure value with respect to sparse representation based classification, Cost-Sensitive Support Vector Machine, and Cost-Sensitive Semisupervised Support Vector Machine. Moreover, the method we proposed achieved a more stable performance with the increasing of imbalance ratio. Similarly, G-mean (the geometric mean between the classification accuracy of positive class and the classification accuracy of negative class) also achieved a higher value with respect the other three methods in Figure 3.
It is difficult to evaluate the performance of methods solving class-imbalance problem, but we use classification accuracy to reflect the method additionally for persuasive, and this is summarized in Table4. On the other hand, running time represents the computation cost of a method. The result is shown in Table 5. It is obvious that our method can get the highest classification accuracy and the lowest running time on Nursery. In this paper, we use sparse representation coefficient vectors to estimate the posterior probability; this can well reduce the computing complexity and computation cost.Table 4
Classification accuracy on Nursery.
Accuracy
1
2
3
4
5
6
7
8
9
10
SRC
0.9298
0.9305
0.9343
0.9412
0.9420
0.9460
0.9484
0.9484
0.9530
0.9572
CS4VM
0.9186
0.9256
0.9307
0.9345
0.9335
0.9414
0.9400
0.9396
0.9369
0.9421
CSSVM
0.9279
0.9398
0.9314
0.9393
0.9345
0.9319
0.9285
0.9279
0.9285
0.9294
CSSRC
0.9601
0.9623
0.9610
0.9585
0.9610
0.9600
0.9610
0.9627
0.9597
0.9616Table 5
Running time on Nursery.
Time/s
1
2
3
4
5
6
7
8
9
10
SRC
0.0105
0.0385
0.0664
0.0973
0.1324
0.1721
0.2158
0.2620
0.3137
0.3702
CS4VM
1.7131
1.7114
1.9854
2.0866
2.0969
2.2246
2.2572
2.3539
2.3044
2.4455
CSSVM
3.7136
8.5207
15.1722
23.3593
33.2055
45.8405
59.8414
74.8664
93.9153
115.6757
CSSRC
0.0102
0.0237
0.0408
0.0594
0.0818
0.1069
0.1328
0.1594
0.1907
0.2236Figure 2
The result ofF-measure on Nursery.Figure 3
The result ofG-mean on Nursery.Experiment 2.
In this experiment, we intend to validate the applicability of our method for class-imbalance problem. In Experiment1 we have tested the validity of our method when the class distribution of training samples is imbalance. Now, we will select some training samples to validate our method, where the distribution of training samples is imbalance. Table 1 has summarized the information of data sets we used, and the imbalance ratio of Letter is 24.3. In order to set a higher imbalance ratio, we select Letter in this experiment. Similarly, we compare the performance of these four methods (SRC, CSSVM, CS4VM, and CSSRC) on Nursery. In this experiment, we take the imbalance ratio from [
1,2
,
…
,
10
], respectively. The size of minority class is 30 and the majority class is 30 multiplying the imbalance ratios in training set, accordingly. We select 61 positive samples and 61 negative samples as test set and run and summarize the results as Figures 4 and 5; the sampling process has repeated 100 times and gets the average results.
Figure4 has shown the F-measure with imbalanced training samples; Figure 5 has shown the F-measure with imbalanced test samples. It is obvious that our method achieves a stable and higher result on Letter than the other three methods from Figures 4 and 5. Although sparse representation based classification has a similar result of F-measure with our method in Figure 5, the running time is higher than our method in Table 6. Much experiments has been done in this section, we have compared F-measure with the imbalanced distribution of training samples and testing samples and running time, we can easily make a conclusion that our method is better than the other three methods, and we can well resolve the class-imbalance problem.Table 6
Running time on Letter.
Time/s
1
2
3
4
5
6
7
8
9
10
SRC
0.0968
0.4103
0.6356
0.9178
1.2650
1.6695
2.1277
2.6364
3.3029
3.8405
CS4VM
2.0102
2.3504
2.6401
2.9405
3.2302
3.5415
3.8596
4.1482
5.4454
5.7497
CSSVM
7.5763
14.9397
22.1502
25.5690
37.0908
44.1674
51.6777
59.1158
66.6602
74.3515
CSSRC
0.0308
0.1170
0.1914
0.2806
0.3954
1.3279
1.4672
1.6153
1.7826
1.9640Figure 4
The result ofF-measure on Letter (the distribution of training samples is imbalanced).Figure 5
The result ofF-measure on Letter (the distribution of test samples is imbalanced).


## 5. Conclusions and Future Works

This paper, we propose a novel cost-sensitive SRC classifier approach. The proposed approach adopted probabilistic model and sparse representation coefficient matrix to estimate the prior probability and then obtain the label of a testing sample by minimizing the misclassification losses. The experimental results show that the proposed cost-sensitive SRC has a comparable or even lower total cost with higher accuracy compare to the other three classification algorithms. Much experiment has been done and concluded that our method can well solve the class-imbalance problem. In real-world application, nearly all the data sets are class-imbalance. Our research can overcome the difficult the imbalanced distribution of data sets brought in.In order to simplify the cost matrix, we restrict our discussion to two-class problems. So extending our current work to multiclass scenario is a main research direction for our future work.



---

*Source: 8035089-2016-12-22.xml*