# Cost-Sensitive Variational Autoencoding Classifier for Imbalanced Data Classification
## 1 Introduction  
Classification is a primary function of machine learning [1]. Some existing classification algorithms, such as support vector machines, decision trees, neural networks, and Bayesian classifiers, are widely used. However, they are typically based on the assumption that the distribution of data categories is roughly balanced [2]. However, this assumption is not valid for many practical tasks. In realistic classification tasks, the sample size of one category is likely to be much smaller than that of the other. For example, [PERSON] et al. 's study on detecting oil spills through satellite radar images showed that the imbalance ratio of the dataset used reached 22:1 [3]. Similarly, [PERSON] et al. studied the identification of auto insurance fraud. The imbalanced dataset used in this study had 108,000 samples, of which, only 7.4% were fraudulent samples. There is also a large amount of imbalanced data in text classification, medical diagnosis, network intrusion monitoring, and other fields [4]. Traditional classification algorithms consider overall classification accuracy as the learning goal. When the classification data are imbalanced, traditional machine learning algorithms pay more attention to the majority-class samples and ignore the minority-class samples to increase the overall classification accuracy [5]. Thus, traditional machine learning algorithms do not perform well in the task of identifying members of minority data classes. In addition to classification accuracy, in many cases, the cost of the misclassification of a minority sample is much greater than that of the misclassification of a majority sample. For example, in medical diagnosis tasks, the identification of minority-class (ill) samples as majority-class (normal) samples may seriously delay the treatment time of patients and cause major medical accidents. Therefore, if the misclassification cost of minority samples is treated equally to the misclassification cost of majority samples, significant errors in the practical application of the classifier may result. The imbalanced data classificationproblem focuses on the performance of classifiers in the case of imbalanced data categories, and research on this problem has attracted considerable interest as a popular topic in the field of machine learning [6]. Research on imbalanced data classification has been mainly carried out on the levels of data, algorithms, and evaluation criteria. Existing algorithms for imbalanced data mainly involve improvements at a single level. In this paper, an imbalanced data classification algorithm termed a cost-sensitive variational autoencoding classifier (cost-sensitive VAE) is proposed, which involves both the data level and algorithm level. The main contributions of the present work are summarized as follows. * We propose a cost-sensitive variational autoencoding classifier for imbalanced data classification. In contrast to traditional imbalanced classification algorithms, which usually involve only one level, the proposed approach adapts to imbalanced data at the levels of data and algorithms. A cost-sensitive matrix is introduced to improve the recognition rate of minority samples, and data can be generated by generators to expand the minority classes from the data level. Experiments 1 and 2 show that this method has a good classification performance on imbalanced datasets. Experiment 1 confirmed that each category in the classification task exhibited good Precision, Recall, and F1-score by this method, with the F1-score, Precision, and Recall of the minority class (BMG) being 0.9432, 0.9644, and 0.9239, respectively. Experiment 2 confirmed that the cost-sensitive factor \(\alpha\) in this method has a beneficial effect on the Precision, Recall, and F1-score of each category, which affects minority categories more obviously than majority categories. * A cost-sensitive matrix design based on domain-knowledge embedding is proposed.