Many current deep learning methods for visual recognition tasks often rely on large amounts of labeled training data to achieve high performance. Collecting and annotating such large training datasets is expensive and impractical in many cases. In order to speed up the research progress, the cross-domain few-shot learning (CD-FSL) challenge  has been released. It contains data from the CropDiseases, EuroSAT, ISIC2018 and ChestX datasets. The selected datasets can reflect the actual use cases for deep learning.
Meta-learning is a widely used strategy for few-shot learning. However, recent research  indicates that traditional “pre-training and fine-tuning” can outperform meta-learning based few-shot learning algorithms when there exists a large domain gap between source base classes and target novel classes. Nevertheless, the capacity of fine-tuning can still be limited when facing the large domain gap. To tackle this problem, in the paper, we propose a batch spectral regularization (BSR) mechanism to suppress all the singular values of the feature matrix in pre-training so that the pre-trained model can avoid overfitting to the source domain and generalize well to the target domain. Moreover, we propose a feature transformation ensemble model that builds multiple predictors in projected diverse feature spaces to facilitate cross-domain adaptation and increase prediction robustness. To mitigate the shortage of labeled data in the target domain, we exploit the unlabeled query set in fine-tuning through entropy minimization. We also apply a label propagation (LP) step to refine the original classification results, and exploit data augmentation techniques to augment both the few-shot and test instances from different angles to improve prediction performance. Experiments are conducted on the CD-FSL benchmark tasks and the results demonstrate the superiority of our proposed model over the strong fine-tuning baseline.
In the cross-domain few-shot learning setting, we have a source domain and a target domain . We use all the labeled data in the source domain for pre-training. In the target domain, a numbe of -way -shot classification tasks are sampled, each with a support set composed of labeled examples from novel classes. The labeled support set can be used to fine-tune the pre-trained model, while a query set from the same classes is used to evaluate the model performance. Inspired by the ensemble networks for zero-shot learning , we build an ensemble prediction model for cross-domain few-shot learning. The overview of our proposed ensemble model is depicted in Fig. 1. Below we introduce the components involved in the model.
2.1 Feature Transformation Ensemble Model
We build the ensemble model by increasing the diversity of the feature representation space while maintaining the usage of the entire training data for each prediction branch network. As shown in Fig. 1
, we use a Convolutional Neural Network (CNN)to extract advanced visual features from the input data, and then transform the features into multiple diverse feature representation spaces using different random orthogonal projection matrices on different branches. Each projection matrix is generated in the follow way. We randomly generate a symmetric matrix
, and then form the orthogonal matrix
using the eigenvectors ofsuch that , where represents the eigenvector corresponding to the top
-th eigenvalue of. With each projection matrix , we can transform the extracted features into a new feature representation space such that , and build a soft-max predictor in this feature space. By using randomly generated orthogonal projection matrices, we can then build classifiers. In the pre-training stage in the source domain, all the labeled source data is used to train each branch network, which includes the composite feature extractor , and the classifier , by minimizing the cross-entropy loss. In a training batch
, the loss function can be written as
where denotes the cross-entropy loss function. After pre-training in the source domain, the fine-tuning on the labeled support set of the target domain can be conducted in the similar way, while the testing on the query instances can be naturally produced in an ensemble manner by taking the average of the classifiers’ prediction results.
2.2 Batch Spectral Regularization
Previous work  shows that penalizing smaller singular values of a feature matrix can help mitigate negative transfer in fine-tuning. We extend this penalizer into the full spectrum and propose a batch spectral regularization (BSR) mechanism to suppress all the singular values of the batch feature matrices in pre-training, aiming to avoid overfitting to the source domain and increase generalization ability to the target domain. This regularization is applied for each branch network of the ensemble model separately in the same way. For simplicity, we omitted the branch network index in the following presentation.
Specifically, for a stochastic gradient descent based training algorithm, we work with training batches. Given a batch of training instances, its feature matrix can be obtained as , where is the batch size and
is the feature vector for the-th instance in the batch. The BSR term can then be written as
where are singular values of the batch feature matrix . The spectral regularized training loss for each batch will be:
2.3 Label Propagation
Due to the lack of labeled data in the target domain, the model fine-tuned with the support set can can easily make wrong predictions on the query instances. Following the effective label refinement procedure in , we propose to apply a label propagation (LP) step to exploit the semantic information of unlabeled test data in the extracted feature space and refine the original classification results.
Given the prediction score matrix on the query instances with the fine-tuned classifier , we keep the top- fraction of scores in each class (the columns of ) and set other values to zeros in order to propagate only the most confident predictions. We then build a k-NN graph over the query instances based on the extracted features . We use the squared Euclidean distance between each pair of images such as
to determine the k-NN graph. The RBF kernel based affinity matrixcan be computed as follows:
where is the radius of the RBF kernel and denotes the k-nearest neighbors of the -th image. The normalized Laplacian matrix can then be calculated as , where is a diagonal matrix with . The label propagation is then performed to provide the following refined prediction score matrix:
is an identity matrix andis a trade-off parameter. After LP, is used as the predicted class for the -th image.
2.4 Entropy Minimization
We extend the semi-supervised learning mechanism into the fine-tuning phase in the target domain by minimizing the prediction entropy on the unlabeled query set:
where denotes a query batch. We can add this term to the original cross-entropy loss on the support set batch and form a transductive fine-tuning loss function:
where is a trade-off parameter.
2.5 Data Augmentation
We also exploit data augmentation (DA) strategy with several random operations to supplement the support set and make the models learn with more variations. In particular, we use combinations of some operations such as image scaling, random crop, random flip, random rotation and color jitter to generate a few variants for each image. The fine-tuning can be conducted on the augmented support set. The same augmentation can be conducted for the query set as well, where several variants of each image can be generated to share the same label. Thus the prediction result on each image can be determined by averaging the prediction results on all the augmented variants of the same image.
Flip probability: 50%
|ISIC & EuroSAT||
|ChestX||S + SJH + C + CJ + CH|
|5-way 5-shot||5-way 20-shot||5-way 50-shot||5-way 5-shot||5-way 20-shot||5-way 50-shot|
|5-way 5-shot||5-way 20-shot||5-way 50-shot||5-way 5-shot||5-way 20-shot||5-way 50-shot|
In the experiments, we use the evaluation protocol in the CD-FSL challenge 
, which takes 15 images from each class as the query set and uses 600 randomly sampled few-shot episodes in each target domain, The average accuracy and 95% confidence interval are reported.
As for the model architecture, we use ResNet-10 as the CNN feature extractor and a fully-connected layer with soft-max activation as the classifier . We set the trade-off parameters , and the number of branches . For the label propagation step, we use for the k-NN graph construction, and set as the average of the squared distances of the edges in the k-NN graph. The parameters and
are set to 0.2 and 0.5 respectively. We adopt mini-batch SGD with momentum of 0.9 for both pre-training and fine-tuning. During the pre-training stage, models are trained for 400 epochs. The learning rate and the weight decay are set to 0.001 and 0.0005 respectively. During fine-tuning, we set the learning rate to 0.01 and fine-tune for 100 epochs.
We investigate a number of variants of the proposed model by comparing with the strong fine-tuning baseline result reported in . We first investigate a single prediction network with batch spectral regularization (BSR) without ensemble and its other variants that further incorporate label propagation (LP) or/and data augmentation (DA). Then we extend these variants into the ensemble model framework with . The results are reported in Table 3, and the average accuracies (and 95% confidence internals) across all datasets and shot levels are shown in Table 4.
We can see that even with only BSR, the proposed method can already significantly outperform the fine-tuning baseline (average 70.76% vs 67.23%). The ensemble BSR further improves the results (72.35%). The LP and DA components can also help improve the CD-FSL performance. We observe that on target domains more similar to the source domain, LP performs better than DA and vice versa. This shows that LP and DA focus on different aspects of the data. As a result combining LP and DA can further improve the performances. Moreover, DA is not very effective for the ISIC domain, where it even degrades the performance in some cases. Also the experiment’s running time is typically longer with DA. By replacing DA with ENT, we can obtain similar overall performance. With a single model, the best average result achieved by BSR+LP+DA is 72.85%, while BSR+LP+ENT achieves 72.68%. With the ensemble model, BSR+LP+DA (Ensemble) produces the best average result 73.94%, while BSR+LP+ENT (Ensemble) yields 73.62%.
In this paper, we proposed a feature transformation based ensemble model for CD-FSL. The model also incorporates batch spectral regularization in pre-training, and exploits data augmentation and label propagation during fine-tuning and testing in the target domain. The combinational models produced superior CD-FSL results comparing to the strong fine-tuning baseline.
-  (2019) Catastrophic forgetting meets negative transfer: batch spectral shrinkage for safe transfer learning. In NeurIPS, Cited by: §2.2.
-  (2019) A new benchmark for evaluation of cross-domain few-shot learning. arXiv preprint arXiv:1912.07200. Cited by: §1, §1, §3.1, §3.2, Table 3, Table 4.
Labelless scene classification with semantic matching.. In BMVC, Cited by: §2.3.
-  (2019) Progressive ensemble networks for zero-shot recognition. In CVPR, Cited by: §2.