Multi-label classification (MLC) is a fundamental but challenging problem in machine learning with applications such as text categorization , sound event detection [6, 26], and image classification . In contrast to single-label classification, multi-label predictors must not only relate labels with the corresponding instances, but also exploit the underlying label structures. Take for instance the text classification dataset RCV1 , which uses a hierarchical tree structure between labels.
Recent studies show that MLC can be transformed to a sequence prediction problem by probabilistic classifier chains (PCC)[15, 3, 5]
. PCC models the joint probabilities of output labels with the use of the chain rule and predicts labels based on previously generated output labels. Furthermore, PCC can be replaced by a RNN decoder to model label correlation. wang2016cnn (wang2016cnn) propose the CNN-RNN architecture to capture both image-label relevance and semantic label dependency in multi-label image classification. nam2017maximizing (nam2017maximizing) and yang2018sgm (yang2018sgm) show that state-of-the-art multi-label text classification results can be achieved by using a sequence-to-sequence (seq2seq) architecture to encode input text sequences and decode labels sequentially.
However, this kind of RNN-based decoder suffers from several problems. First, these models are trained using maximum likelihood estimation (MLE) on target label sequences, which relies on a predefined ordering of labels. Previous studies[23, 24] show that ordering has a significant impact on the performance. This issue also appears in the PCC, It is addressed by ensemble averaging [15, 3], ensemble pruning , pre-analysis of the label dependencies by Bayes nets  and integrating beam search with training to determine a suitable tag ordering . However, these approaches rely on training multiple models to ensemble or determine a proper order, which is computationally expensive.
Although nam2017maximizing (nam2017maximizing) and yang2018sgm (yang2018sgm) compare several ordering strategies and suggest ordering positive labels by frequency directly in descending order (from frequent to rare labels), it is unnatural to impose a strict order on labels, which may break down label correlations in a chain. Furthermore, we find that this kind of model tends to overfit to label combinations and shows poor generalization ability.
Second, during training, the RNN-based models are always conditioned on correct prefixes; during inference, however, the prefixes are generated by the RNN-based model, yielding a problem known as exposure bias  in seq2seq learning. The error may propagate as the model might be in a part of the state space that it has not seen during training .
In this paper, we propose a novel learning algorithm for RNN-based decoders on multi-label classification not rely on a predefined label order. The proposed approach is inspired by optimal completion distillation (OCD) , a training procedure for optimizing seq2seq models. In this algorithm, we feed the RNN decoder generated tokens by sampling from the current model. Hence, the model may encounter different label orders and wrong prefixes during training, so the model explores more, and exposure bias is alleviated.
Another common and straightforward way to avoid the need for ordered labels in MLC is binary relevance (BR) , which decomposes MLC into multiple independent single-label binary classification problems. However, this yields a model that cannot take advantage of label co-occurrences. In this paper, we further propose helping the model to learn better by use of an auxiliary binary relevance (BR) decoder jointly trained with the RNN decoder within a multitask learning (MTL) framework.
In addition, at the inference stage, the predictions of the BR decoder can be jointly combined in the RNN decoder to improve performance further. We propose two methods to combine their probabilities. Extensive experiments show that the proposed model outperforms competitive baselines by a large margin on three multi-label classification benchmark datasets, including two text classification and one sound event classification datasets.
The contributions of this paper are as follows:
We propose a novel training algorithm for multi-label classification which predicts labels autoregressively but does not require a predefined label order for training.
We compare our methods with competitive baseline models on three multi-label classification datasets and demonstrate the effectiveness of the proposed models.
We systematically analyze the problem of exposure bias and the effectiveness of scheduled sampling  in multi-label classification.
RNN-based multi-label classification
To free the RNN-based MLC classifier from a predefined label order, chen2017order (chen2017order) proposes the order-free RNN to dynamically decide a target label at each time during training by choosing the label in the target label set with the highest predicted probability; hence, the model learns a label order by itself. Although the order can be modified during training, this approach still needs an initialized label order to start the training process. We find order-free RNN shows poor generalization ability to unseen label combinations in the experiments. Also, as the model is always supplied with the correct labels, it suffers from exposure bias.
To handle both exposure bias and label order, other studies apply a reinforcement learning (RL) algorithm to MLC. he2018reinforced (he2018reinforced) apply an off-policy Q learning algorithm to multi-label image classification. yang2018deep (yang2018deep) uses two decoders to solve multi-label text classification, one of which is trained with MLE and the other is trained with a self-critical policy gradient training algorithm. However, Q learning and policy gradients cannot easily incorporate ground truth sequence information, except via the reward function, as the model is rewarded only at the end of each episode. Indeed, he2018reinforced (he2018reinforced) does not work without pretraining on the target dataset. By contrast, we use optimal completion distillation (OCD) for MLC, which optimizes token-level log-loss, where the training is stabilized and requires neither initialization nor joint optimization with MLE.
Optimal Completion Distillation (OCD)
Our work is inspired by OCD , which was first used in the context of end-to-end speech recognition in which it achieved state-of-the-art performance. In contrast to MLE, OCD algorithms encourage the model to extend all possible tokens that lead to the optimal edit distance by assigning equal probabilities to the target policy that the model learns from. We use OCD to train the RNN decoder in MLC. The OCD training details for MLC are in section Learning for RNN decoder . In contrast to the original OCD  which optimizes the edit distance, in the proposed approach we optimize the numbers of missing and false alarm labels.
An overview of the proposed model is shown in Fig. 1. The model is composed of three components: encoder , RNN decoder , and binary relevance decoder . Here, multi-label text classification is considered an instance of MLC. For other types of MLC other than text classification (e.g. sound event classification), the architecture of the encoder can be changed.
We employ a bidirectional LSTM as an encoder . The encoder reads the input text sequence of words in both forward and backward directions and computes the hidden states for each word.
The RNN decoder seeks to predict labels sequentially. It is potentially more powerful than the binary relevance decoder because each prediction is determined based on the previous prediction: thus it implicitly learns label dependencies. We implement it using LSTMs with an attention mechanism. Hence, the encoder and RNN decoder form a seq2seq model. In particular, we set the initial hidden state of the decoder and calculate the hidden state and output at time as
where is the predicting label at previous timestep. is estimated with by the following equations:
During sampling, we add a mask vector  to prevent the model from predicting repeated labels, where is the number of labels in the dataset:
Binary relevance decoder
The binary relevance (BR) decoder here is an auxiliary decoder to train the encoder within the multitask learning (MTL) framework. The BR decoder predicts each label separately as a binary classifier for each label, helping the model to learn better. Another advantage of using the BR decoder is that we can consider the predictions of both the RNN and BR decoders to further improve performance.
In particular, we feed the final hidden state of encoder to a DNN with a final prediction layer of size
with sigmoid activation functions to predict the probabilities of each label. To take into account vanishing gradients for long input sequences, we add another attention module. In particular, we calculated the context vectorin the attention mechanism with the output of fully-connected layers and then compute probabilities as
where is the matrix of weight parameters and indicates the concatenation of and .
In this section, we derive the training objective for the RNN decoder , the BR decoder , and the multitask learning objective.
Learning for RNN decoder
RNN decoder learning as RL
To reduce exposure bias and free the model from relying on a predefined label order, we never train on ground truth target sequences. Instead, we approach the MLC problem from an RL perspective. The model here plays the role of an agent whose action is the current generated label at time and whose state is the output labels before time . The policy
is a probability distribution over actionsgiven states . Once the process is ended with an end-of-sentence token, the agent is given a reward .
In our approach, reward is defined as
where and are the ground truth labels and the sequence of labels generated by the RNN decoder, and is the relative complement of set A in set B.
The first and second term of reward are the number of labels that were not predicted and the number of misclassified labels, respectively.
Optimal completion distillation
However, typical RL algorithms, such as Q learning and policy gradients, cannot easily incorporate ground truth sequence information except via the reward function. Here we introduce optimal Q-values, which evaluates each action at each time .
Optimal Q-values represents the maximum total reward the agent can acquire after taking action at state via subsequently conducting the optimal action sequence. Optimal Q-values at time can be expressed as
where is a complete sequence, which is the concatenation of token sequence generated before time , action at time and optimal subsequent action sequence .
Optimal policy at time can be calculated by taking a softmax over optimal Q-values of all the possible actions. Formally,
where is a temperature parameter. If is close to , is a hard target. Table 1 shows an example illustrating the optimal policy in OCD training procedure.
Given a dataset , we first draw generated sequences from the RNN decoder
by sampling. The loss functioncan be obtained via calculating KL divergence between the optimal policy and the model’s generated distribution over labels at every time step ,
The above equation means we “distill” knowledge from optimal policies obtained by completing with optimal action sequences to RNN decoder , so RNN decoder can have similar behaviour as optimal policy .
In contrast to MLE, OCD encourages the model to extend all the possible targets resulting in the same evaluation metric score. Therefore, the OCD objective focuses on all labels that were not predicted and assigns them equal probabilities. Once all the target labels are successfully generated, the objective guides the model to produce the end-of-sentence token with probability.
Since the OCD targets depend only on the tokens generated previously, we do not need a human-defined label order to train the RNN decoder. The label order is instead automatically determined at each time step. In addition, we always train on sequences generated from the current model, thus alleviating exposure bias. Note that we can substitute the reward function (Eq. 7) with other example-based test metrics such as the example-based F1 score (Eq. 19 in the Appendix), but these lead to the same OCD targets as the rewards of all the target labels are the same.
|0||A, B, D||B|
Learning for binary relevance decoder
For the binary relevance decoder, given the ground truth in binary format, we use binary cross-entropy loss as the objective:
where , which is a vector of length representing the predicted probability of each label.
Multitask Learning (MTL)
The objective of MTL is
where is a weight.
In this section, we seek to utilize both the RNN and BR decoders to find the optimal hypothesis , which consists of predicted labels , where is the end-of-sentence token indicating that the decoding process of the RNN decoder has ended.
For the BR decoder, the outputs after a sigmoid activation
are designed to estimate the posterior probabilities of each label. Therefore, the theoretically optimal threshold for converting the probability to a binary value should be 0.5, which is equivalent to finding the optimal hypothesis that maximizes the Eq. 13 below, which is the product of the probabilities of all the labels.
Nonetheless, the equation is not easy to solve because the RNN decoder outputs the probability of selecting a particular label at each time step while the BR decoder produces the unconditional probabilities of all the labels at once. To incorporate the BR probabilities of labels in the score, we provide two different decoding strategies to find the best hypothesis .
In this method, we first obtain a set of complete hypotheses using beam search only with the RNN decoder, and rescore each hypothesis using the probabilities produced by the BR decoder with Eq. 13. Finally, we select as the final prediction the hypothesis with the highest .
Logistic Joint Decoding
This method is one-pass decoding. We conduct a beam search according to the following equation (see the derivation in Appendix Derivation of logistic joint decoding).
Note that we manually set the probability of the end-of-sentence token for binary relevance , since it does not exist in the outputs of the BR decoder.
We validate our proposed model on two multi-label text classification datasets, which are AAPD  and Reuters-21758, and a sound event classification dataset, which is Audio set  proposed by Google. They span a wide variety in terms of the number of samples, the number of labels, and the number of words per sample. Due to space limit, we put an extra experiment in text classification on RCV1-V2 , data statistics, experimental settings and the descriptions of five evaluation metrics in Appendix.
|(a) Seq2set (simp.)|
|(g) Seq2seq + SS||0.541||0.703||0.713||0.406||0.9742||0.667|
|(h) Order-free RNN||0.539||0.696||0.708||0.413||0.9742||0.666|
|(i) Order-free RNN + SS||0.548||0.699||0.709||0.416||0.9743||0.669|
|OCD + MTL||(k) RNN dec.||0.578||0.711||0.727||0.391||0.9742||0.676|
|(l) BR dec.||0.562||0.711||0.718||0.382||0.9760||0.670|
|(m) Logistic rescore||0.585||0.720||0.736||0.395||0.9749||0.682|
|(n) Logistic joint dec.||0.580||0.719||0.731||0.399||0.9753||0.681|
Multi-label classification can be evaluated with multiple metrics, which capture different aspects of the problem. We follow nam2017maximizing (nam2017maximizing) in using five different metrics: subset accuracy (ACC), Hamming accuracy (HA), example-based F1 (ebF1), macro-averaged F1 (maF1), and micro-averaged F1 (miF1).
We compare our methods with the following baselines. For a fair comparison, the architecture of all the encoders are the same except for BR++: the RNN decoders for Seq2seq, Order-free RNN, and the proposed approaches are the same.
Binary Relevance (BR) is the model trained with logistic loss (Eq. 11), and consists of an encoder and a BR decoder.
Binary Relevance++ (BR++) is a model with a larger encoder but with the same training algorithm as BR. Because the MTL model has more parameters than BR, for fair comparison, we increase the number of layers in the encoder RNN so that the number of parameters is approximately equal to the MTL model. 111Since yu2018multi (yu2018multi) have tested different architectures of BR models on Audio set, we do not use BR++ as a baseline.
Seq2seq  is composed of an RNN encoder and an RNN decoder with an attention mechanism. The model is trained with MLE. The target label sequences are ordered from frequent to rare, which yields better performance [12, 25]. 222For Audio set, the architecture of the encoder is described in Appendix and is not based on RNN. For consistency, we denoted it as Seq2seq.
Order-free RNN  uses an algorithm for multi-label image classification to train the RNN decoder without predefined orders but suffers from exposure bias.
Since scheduled sampling also tackles the problem of exposure bias, we also compare the performance of seq2seq and order-free RNN with scheduled sampling (SS), which are Seq2seq + SS and Order-free RNN + SS. The detailed discussion of the effectiveness of scheduled sampling is in section Disussion.
Results and Discussion
|Order-free RNN + SS||0.452||0.859||0.896||0.836||0.9962||0.808|
|OCD + MTL||RNN dec.||0.475||0.874||0.905||0.844||0.9966||0.819|
|Logistic joint dec.||0.490||0.874||0.904||0.843||0.9967||0.822|
In the following, we show results of the baseline models and the proposed method on three text datasets. For MTL models, we show the results of the four kinds of different decoding strategies described in section Decoder Integration. For a simple comparison, we also compute averages of the five metrics as a reference. Note that blue an bold texts in Table 2-4 mean that the performance of proposed methods surpass all the baselines and the highest performance in each measure.
Experiments on AAPD
The experimental results on the AAPD dataset are shown in Table 2. We see that different models are skilled at different metrics. For example, RNN decoder based models, i.e. Seq2seq in row (f) and Order-free RNN in row (h), perform well on ACC, whereas BR and BR++ have better results in terms of HA but show clear weaknesses in predicting rare labels (cf. especially maF1). However, OCD in row (j) performs better than all the baselines (row (d)–(i)) (0.672 on average),333Except for ACC: the reason is given in the following discussion. especially in miF1 (0.707) and ebF1 (0.737), which verifies the power of the proposed training algorithm.
|Seq2seq + SS||0.340||0.448||0.419||0.137||0.9943||0.468|
|Order-free RNN + SS||0.310||0.437||0.408||0.095||0.9947||0.449|
|OCD + MTL||RNN dec.||0.359||0.466||0.438||0.115||0.9940||0.474|
|Logistic joint dec.||0.377||0.488||0.454||0.119||0.9945||0.487|
For MTL, we report the performance for the decoding strategies from section Decoder Integration. The first two decoding methods (rows (k),(l)) consider only the predictions of one decoder, while the other two (rows (m),(n)) combine the predictions using different decoding strategies. With MTL, we see the performance is improved across all the metrics except for ACC (row (j) v.s. row (k)). In addition, joint decoding methods (row(m),(n)) achieve the best performance, and outperform previous works (row(a),(b),(c)). Interestingly, BR is also improved significantly with MTL (row (d) v.s. row(l)), the encoder of which may implicitly learn the label dependencies through the RNN decoder, which the original BR (row (d)) ignores.
Fig. 2 shows the validation ACC and miF1 curves for OCD, BR, and MTL with three decoding methods. BR performs the worst and converges the slowest. Nonetheless, with the help of MTL, BR converges much faster and better. Also, MTL helps to improve the performance of the OCD model.
|Seen test set||Unseen test set|
|Seq2seq + SS||0.736||0.754||0.517||0.515|
|Order-free RNN + SS||0.724||0.740||0.520||0.517|
|OCD (correct prefix)||0.726||0.741||0.513||0.515|
Experiments on Reuters-21758
In comparison with AAPD, Reuters-21758 is a relatively small dataset. The average number of labels per sample is only 1.24 and over 80% of the samples have only one label, making for a relative simple dataset.
Table 3 shows the results of the methods. These results demonstrate again the superiority of OCD and the performance gains afforded by the MTL framework. Since there are over 80% of test samples only have one label in this corpus, to truly know the effect of proposed approaches to multi-label classification, we also provide results only on test samples with more than one label in the Section Analysis of Reuters-21758 in Appendix.
Experiments on Audio set
|Models||Case 1||Case 2||Case 3|
|Ground truth||cs.it, math.it, cs.ds||cs.lg, stat.ml, math.st, stat.th||cs.it, math.it, cs.ds, cs.dc|
|Seq2seq||cs.it, math.it, cs.ni||cs.it, math.it, math.st, stat.th||cs.it, math.it, cs.ni|
|Order-free RNN||math.it, cs.it||math.it, cs.it, stat.th, math.st||math.it, cs.it, cs.ni|
|OCD||math.it, cs.it, cs.ds||stat.ml, stat.th, cs.lg, math.st||cs.it, math.it|
|OCD + MTL + joint dec.||cs.it, math.it||math.st, stat.th, stat.ml, cs.lg, cs.it, math.it||math.it, cs.it|
|erence||OCD||Seq2seq||+ SS||OfRNN||+ SS|
Table 4 shows the performance of each model. In this experiment, all models have similar performance in HA. Surprisingly, BR is a competitive baseline model and performs especially well in miF1. Seq2seq achieves the best performance in terms of ACC, which is the same as the observation on AAPD. Overall, OCD performs better than all the baseline and MTL indeed improves the performance. OCD outperforms other RNN decoder-based models in maF1, miF1 and ebF1 and performs worse than BR only in terms of miF1.
Propagation of errors
Fig. 3 shows position-wise accuracy of different models at each time step of RNN decoder on Audio set. The accuracy is calculated by checking whether or not model’s generated labels are in reference label sets and then averaging the errors at each time step. If a generated label sequence is less than the corresponding target label sequence, the unpredicted part of the sequence is considered wrong.
We can see that accuracy of all models decreases dramatically along x-axis. Because the labels are generated sequentially, the models would condition on wrong generated prefix label sequence in the test stage. This problem may be amplified when the generated sequence is longer because of accumulation of errors. Compared with the baseline models, OCD+MTL and OCD perform better after position 2, which demonstrates that they are more robust against error propagation, or exposure bias. Similar phenomenon can be observed in AAPD ( Fig. 6 in Appendix).
Effectiveness of scheduled sampling and OCD
To demonstrate the effectiveness of scheduled sampling and OCD when dealing with exposure bias, we evaluate the performance of models when tackling with unseen label combinations, where models encounter unseen situations and the problem of exposure bias may be more severe.
In this experiment, since there are only 43 samples with unseen label combinations in original test set of AAPD, we resplited the AAPD dataset: 47840 samples in training set, 4000 samples for validation set and test set, respectively. Both validation set and test set contain 2000 samples whose label sets occur in the training set and 2000 samples are not.
Table 5 shows the results on resplited AAPD. OCD (correct prefix) means we only sample correct labels in the training phase, so this model has not encountered wrong prefix during training. Clearly, all models perform worse on unseen test set. We can see that SS improves the performance significantly on the unseen test set for both seq2seq and order free RNN. Additionally, OCD with correct prefix, which suffers from the exposure bias, performs worse in both case than OCD. They all demonstrate that sampling wrong labels from predicted distribution helps models become more robust when encountering rare situation.
SS for MLC has a potential drawback. The input labels of RNN decoders obtained by sampling could be labels which do not conform to the predefined order. This may mislead the model. However, there is no label ordering in OCD, so this problem does not exist.
On both seen and unseen test set, OCD performs the best since OCD not only alleviates exposure bias but also does not need predefined order. Results of five metrics and another experiment about exposure bias on AAPD can be found in Appendix.
Problem of overfitting
Table 7 shows number of different generated label combinations (), and the number of generated label combinations that do not occur in the training label sets () on three datasets. Seq2seq and OfRNN produce fewer kinds of label combinations on AAPD and Reuters-21758. As they tend to “remember” label combinations, the generated label sets are most alike, indicating a poor generalization ability to unseen label combinations. Because seq2seq is conservative and only generates label combinations it has seen in the training set, it achieves the highest ACC in Tables 2 and 4. For models with SS, they produce more kinds of label combinations, except for Audio set. OCD produces the most unseen label combinations on three datasets, since it encounters different label permutations during training.
Table 6 shows examples of generated label sequences using different models on AAPD. Note labels cs.it and math.it in the three cases: Seq2seq produces label sequences only from frequent to rare, which is the same as the ground truth order, while order-free RNN learns the order implicitly. In contrast, OCD generates label sequences with flexible orders because it encounters different label permutations in the sampling process during training.
In this paper, we propose a new framework for multi-label classification based on optimal completion distillation and multitask learning. Extensive experimental results show that our method outperforms competitive baselines by a large margin. Furthermore, we systematically analyze exposure bias and the effectiveness of scheduled sampling.
-  (2015) Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 1171–1179. Cited by: 3rd item.
-  (2017) Order-free rnn with visual attention for multi-label classification. arXiv preprint arXiv:1707.05495. Cited by: Decoder Integration, 4th item.
-  (2010) Bayes optimal multilabel classification via probabilistic classifier chains. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 279–286. Cited by: Introduction, Introduction.
-  (2005) An analysis of the relative hardness of reuters-21578 subsets. Journal of the American Society for Information Science and technology 56 (6), pp. 584–596. Cited by: Table 3.
-  (2012) An analysis of chaining in multi-label classification.. In ECAI, pp. 294–299. Cited by: Introduction.
-  (2017) Audio set: an ontology and human-labeled dataset for audio events. In 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 776–780. Cited by: Introduction, Experimental Setup, 4th item.
-  (2014) Adam: a method for stochastic optimization. arXiv preprint arXiv:1412.6980. Cited by: Experimental Settings.
Audio set classification with attention model: a probabilistic perspective. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 316–320. Cited by: Multi-label sound event classification.
-  (2013) Beam search algorithms for multilabel learning. Machine learning 92 (1), pp. 65–89. Cited by: Introduction.
-  (2004) Rcv1: a new benchmark collection for text categorization research. Journal of machine learning research 5 (Apr), pp. 361–397. Cited by: Introduction, Experimental Setup, 3rd item.
-  (2013) Selective ensemble of classifier chains. In International Workshop on Multiple Classifier Systems, pp. 146–156. Cited by: Introduction.
-  (2017) Maximizing subset accuracy with recurrent neural networks in multi-label classification. In Advances in neural information processing systems, pp. 5413–5423. Cited by: 3rd item, Table 3, Evaluation Metrics.
-  (2012) Multilabel classifiers with a probabilistic thresholding strategy. Pattern Recognition 45 (2), pp. 876–883. Cited by: Multi-label text classification.
-  (2015) Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732. Cited by: Introduction.
-  (2011) Classifier chains for multi-label classification. Machine learning 85 (3), pp. 333. Cited by: Introduction, Introduction.
-  (2018) Optimal completion distillation for sequence learning. arXiv preprint arXiv:1810.01398. Cited by: Introduction, RNN-based multi-label classification, Optimal Completion Distillation (OCD).
-  (2014) On the problem of error propagation in classifier chains for multi-label classification. In Data Analysis, Machine Learning and Knowledge Discovery, pp. 163–170. Cited by: Introduction.
-  (2014) Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research 15 (1), pp. 1929–1958. Cited by: Experimental Settings.
Multi-label classification with bayesian network-based chain classifiers. Pattern Recognition Letters 41, pp. 14–22. Cited by: Introduction.
-  (2018) Adversarial learning of label dependency: a novel framework for multi-class classification. arXiv preprint arXiv:1811.04689. Cited by: Introduction.
-  (2007) Multi-label classification: an overview. International Journal of Data Warehousing and Mining (IJDWM) 3 (3), pp. 1–13. Cited by: Introduction.
-  (2018) Learning approximate inference networks for structured prediction. arXiv preprint arXiv:1803.03376. Cited by: Multi-label text classification.
-  (2016) Order matters: sequence to sequence for sets. In International Conference on Learning Representations (ICLR), External Links: Cited by: Introduction.
-  (2018) A deep reinforced sequence-to-set model for multi-label text classification. arXiv preprint arXiv:1809.03118. Cited by: Introduction, Table 2, Multi-label text classification.
-  (2018) SGM: sequence generation model for multi-label classification. In Proceedings of the 27th International Conference on Computational Linguistics, pp. 3915–3926. Cited by: Introduction, RNN decoder , Decoder Integration, 3rd item, Table 2, Experimental Setup, Multi-label text classification.
-  (2018) Multi-level attention model for weakly supervised audio classification. arXiv preprint arXiv:1803.02353. Cited by: Introduction, Multi-label sound event classification.
Derivation of logistic joint decoding
Datasets and Preprocessing
We used three multi-label text classification datasets and one sound event classification dataset. The statistics of the four datasets are shown in Table 8.
reuters21578/: The Reuters-21758 dataset is a collection of around 10,000 documents that appeared on Reuters newswire in 1987 with 90 classes.
Arxiv Academic Paper Dataset (AAPD): This dataset is provided by yang2018sgm (yang2018sgm) , and consists of the abstracts and corresponding subjects of 55,840 academic computer science papers from arxiv. Each paper has 2.41 subjects on average.
Reuters Corpus Volume I (RCV1-V2): The RCV1-V2 dataset  consists of a large number of manually categorized newswire stories (804,414) with 103 topics.
Audio Set: The Audio set was proposed by Google , which consists of over 2 million 10-second audios covering 527 kinds of audio events, including music, speech, vehicles and animal sounds. Because Google only released bottleneck features provided by a pretrained Resnet-50, we used the features as inputs of models. The inputs are ten 128-dim bottleneck features for each audio clip.
When preparing Reuters-21758, we followed nam2017maximizing (nam2017maximizing) in randomly setting aside 10% of the training instances as the validation set. For AAPD and RCV1-V2, we used the training/validation/test set split from yang2018sgm (yang2018sgm) . For these three text datasets, we filtered out samples with more than 500 words, which removed about 0.5% of the samples in each dataset. For Audio set, we follow yu2018multi (yu2018multi) to use the original training/test set split from Google (no validation set).
We used the Adam optimizer  with a learning rate of 0.0005. In addition, to avoid overfitting, we utilized dropout  and clipped the gradients to the maximum norm of 10. For OCD models, we set the softmax temperature to , which resulted in hard targets. For models with scheduled sampling, we set the teacher forcing ratio from 1.0 (start-of-training) to 0.7 (end-of-training). For MTL models, the weight between OCD and logistic losses was 1.
Different settings of three multi-label classification datasets and Audio set are in following.
Multi-label text classification
The BR decoder is a 3-layer DNN with 512 leaky-RELU units. The word embeddings were initialized randomly; their size was 512.
During training, we trained the model for a fixed number of epochs and monitored its performance on the validation set every 1000 updates. Once the training was completed, we chose the model with the best micro-F1 score on the validation set and evaluated its performance on the test set.
During testing, we set the beam size to 6 during the beam search process for all the RNN decoders. For models with BR decoders, we chose the best threshold on the validation set to maximize the micro F1 score, and selected labels whose score was higher than the selected threshold [22, 13].
Multi-label sound event classification
In this experiment, for the BR model, we used the architecture provided by yu2018multi (yu2018multi) 555https://github.com/qiuqiangkong/audioset_classification (2-A-1-A model). To the best of our knowledge, it achieved the best performance on Audio set. We reimplemented the model and achieved similar performance (Mean average precision score 666Because mean average precision measures ranking of confidence scores of each label, which RNN-based approaches can not generate since it only produces hard target sequences. Therefore, we did not utilize it as an evaluation metric. of 0.349 without aggregating the output probabilities of models during training at each epoch).
yu2018multi (yu2018multi) trained their model with binary logistic loss (Eq. 11). We decompose it into two parts: a BR decoder, which is the final fully-connected output layer with sigmoid activation function of their proposed model, and an encoder (the remaining part; without final output layer). For RNN-based model, we set the output of the encoder as the initial state of RNN decoder, which is comprised of 2 layers of LSTM with 512 hidden units. We used the technique of mini-batch balancing .
Because we follow the setting of  and there is no validation set, we trained models for 10 epoches and then test them on the test set. We set the beam size to 6 during the beam search process for all the RNN decoders. For models with BR decoders, we fix the threshold to .
The five metrics can be split in two parts.
Example-based measures are defined by comparing the target vector to the prediction vector . Subset accuracy (ACC) is the most strict metric, indicating the percentage of samples in which all the labels are classified correctly. . Hamming accuracy (HA) is the ratio of the number of correctly predicted labels to the total number of labels. . Example-based F1 (ebF1) defined by Eq. 19 measures the ratio of the number of correctly predicted labels to the total of the predicted and ground truth labels.
Label-based measures treat each label as a separate two-class prediction problem, and compute the number of true positives (tp), false positives (fp), and false negatives (fn) for each label over the dataset.
High maF1 scores usually indicate high performance on rare labels, while high miF1 scores usually indicate high performance on frequent labels .
Experiment on RCV1-V2
|Seq2seq + SS||0.653||0.860||0.878||0.658||0.9914||0.809|
|Order-free RNN + SS||0.637||0.862||0.876||0.662||0.9917||0.806|
|OCD + MTL||RNN dec.||0.671||0.867||0.882||0.651||0.9918||0.813|
|Logistic joint dec.||0.674||0.871||0.885||0.658||0.9920||0.816|
Table 10 shows the results. Compared to AAPD and Reuters-21578, RCV1-V2 consists of a larger number of documents. Moreover, the labels in this dataset have a hierarchical structure. If a leaf label belongs to one document, all labels from the root to the leaf label in the label tree also belong to the document. Hence, if we sort the labels from frequent to rare, parent labels precede child labels in the label tree.
In this dataset, OCD shows a smaller performance gain. This may be because the predefined order contains rich information about hierarchical structures which OCD does not utilize. However, datasets whose label have hierachical structures are not common.
Detailed results of resplited AAPD
|Seen test set|
|Seq2seq + SS||0.551||0.736||0.754||0.449||0.9774||0.693|
|Order-free RNN + SS||0.546||0.724||0.740||0.415||0.9764||0.680|
|Unseen test set|
|Seq2seq + SS||0.418||0.515||0.517||0.009||0.9562||0.483|
|Order free RNN||0.391||0.494||0.496||0.006||0.9560||0.469|
|Order free RNN + SS||0.426||0.517||0.520||0.040||0.9557||0.492|
Impact of exposure bias on AAPD
Fig. 4 shows the example-based F1 score of test samples of different models versus the number of times that the label combination appears in the training set on AAPD. Clearly, the more times the model sees the label combinations, the higher the performance. An interesting observation is that scheduled sampling (SS) helps Seq2seq and OfRNN with rare label combinations but not with frequent ones. This may be because with models that perform poorly when presented with rare situations, exposure bias may become more severe and models are more likely to make wrong predictions. Hence, SS is more helpful with rare examples.
SS performs worse when presented with frequent label combinations. For models with SS, labels obtained by sampling may be labels which do not conform to the predefined order, which may mislead the model. In contrast, OCD performs well consistently. Since in OCD the loss function depends on the input prefixes, and we never supply the ground truth sequence, the model explores more states at the training stage. Hence, it is more robust under all situations.
Analysis of Reuters-21758
|Order-free RNN + SS||0.324||0.699||0.711||0.400||0.9849||0.624|
|OCD + MTL||RNN dec.||0.335||0.745||0.749||0.440||0.9870||0.651|
|Logistic joint dec.||0.342||0.743||0.746||0.435||0.9870||0.651|
Table 12 shows the results on the test set of Reuters-21758 with more than one label. The smaller test set has 405 samples. Comparing to Table 3, all models perform worse on this smaller test set since samples with only one label are taken out. However, the performance gap between baseline models and proposed methods are larger, which strengthen the superiority of OCD and MTL.
Average ranking of models
Fig. 5 shows the average ranks of four datasets using different metrics. Note that all models achieve similar performance on HA on these datasets. Clearly, MTL performs the best, followed by OCD. Note that Seq2seq achieves the best performance in terms of ACC, but it performs worse in terms of other metrics.