## 3 Problem Description and Methodology
### The Proposed Ensemble Learning Framework
#### 3.2.2 Combining Module  
Under the concept of stack generalization, the output of the ensemble serves as the inputs to the metaclassifier, which learns a mapping between the metadata and the real class labels [44]. Metaclassifier selection is also important in ensemble learning, and appropriate data-combining strategies can improve the final classification capabilities. In this paper, we apply a cost-sensitive learning-improved deep neural network (DNN) as a metaclassifier for class imbalance tasks. DNN models have strong learning ability and can extract higher-level features via their deep network structures. Therefore, using a DNN in the ensemble strategy has unique advantages for finding hidden information in metadata. Although DNNs have been successfully applied in many fields because of their powerful data mining ability, few studies have used a DNN to solve typical class imbalance problems in the social networking spam detection field. As shown in Figure 3, the DNN model consists of an input layer, hidden layer(s), and an output layer. The input layer accepts information from the external world into the network. The hidden layer(s) extract multilevel input features to partition the different types of data linearly. Each hidden layer \(h(h\in\{1,\ldots,H\})\) has a set of parameters \(\theta_{h}=\{W_{h},b_{h}\}\), where \(W_{h}\) is a fully connected weight matrix, and \(b_{h}\) is a bias vector. The output layer is responsible for computing and transmitting information from the network to the outside world. The DNN process includes two phases, forward propagation and backpropagation (BP). Forward propagation transmits the input signal to the output layer and produces classification error. BP iteratively  
Figure 3: Schematic of the deep neuron networks. adjusts the weight and offsets of the hidden layer(s) to the output layer and the weight and offset of the input layer to the hidden layer(s). Given a fully connected DNN with \(H\) hidden layers, as shown in Figure 3, during forward propagation, for an input feature vector \(x\), the \(H\) hidden layers of the DNN describe a complex feature transform function by computing:  
\[F(x)=S(W_{h}\cdot S(W_{(h-1)}\cdot\ldots\cdot S(W_{1}\cdot x+b_{1})+\ldots+b_{( h-1)})+b_{h}) \tag{1}\]  
where \(W_{h}\) and \(b_{h}\), respectively, represent the weight matrix and bias vector in each hidden layer \(h(h\in\{1,\ldots,H\})\) denoted as \(\theta_{h}=\{W_{h},b_{h}\}\), \(x\) is the input feature vector from the previous layer, and \(S(z)\) denotes an activation function, which can be tanh or sigmoid. Because the problem of spam identification is a binary classification problem, the output layer has two neurons, and the SoftMax algorithm is used between the hidden layer and the output layer after feature conversion. In the output layer, the \(j\)-th neuron is responsible for estimating the probability that a given sample x belongs to class j:  
\[y_{pred}=\frac{\exp(F(x)W_{out}^{(j)}+b_{out}^{(j)})}{\sum_{k=1}^{2}\exp(F(x)W _{out}^{(k)}+b_{out}^{(k)})} \tag{2}\]  
where \(W_{out}^{(j)}\) and bias \(b_{out}^{(j)}\) represent the weights and bias of the \(j\)-th neuron in the output layer, respectively. Under class imbalance, the goal of the standard machine learning method is to minimize the number of false predictions, but because the loss function uses the same misclassification cost for all the considered classes, it is highly susceptible to skewed class distributions [45]. This occurs because under class imbalance, the loss function is easily minimized by focusing on the majority class and largely ignoring (or in extreme cases even completely ignoring) the minority class. To solve the class imbalance problem of spam detection on social networks, we formalize it as a cost-sensitive classification problem.