Distill-to-Label: Weakly Supervised Instance Labeling Using Knowledge Distillation
Jayaraman J. Thiagarajan Satyananda Kashyap Alexandros Karagyris
cs.CV cs.LG stat.ML




 



























Distill-to-Label: Weakly Supervised Instance Labeling Using Knowledge Distillation 

    Jayaraman J. ThiagarajanThis work was performed under the auspices of the U.S. Departmentof Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
 Lawrence Livermore National Laboratory

 Livermore, USA 

 jjayaram@llnl.gov
 Satyananda Kashyap, Alexandros Karagyris
 IBM Research

 Almaden, USA 

 {satyananda.kashyap,akararg}@us.ibm.com

    December 30, 2023
===================================================================================================================================================================================================================================================================================================================================================================================




Weakly supervised instance labeling using only image-level labels, in lieu of expensive fine-grained pixel annotations, is crucial in several applications including medical image analysis. In contrast to conventional instance segmentation scenarios in computer vision, the problems that we consider are characterized by a small number of training images and non-local patterns that lead to the diagnosis. In this paper, we explore the use of multiple instance learning (MIL) to design an instance label generator under this weakly supervised setting. Motivated by the observation that an MIL model can handle bags of varying sizes, we propose to repurpose an MIL model originally trained for bag-level classification to produce reliable predictions for single instances, i.e., bags of size 1. To this end, we introduce a novel regularization strategy based on virtual adversarial training for improving MIL training, and subsequently develop a knowledge distillation technique for repurposing the trained MIL model. Using empirical studies on colon cancer and breast cancer detection from histopathological images, we show that the proposed approach produces high-quality instance-level prediction and significantly outperforms state-of-the MIL methods.



Multiple instance learning, knowledge distillation, attention mechanism, weak supervision, medical imaging. 




§ INTRODUCTION

The success of supervisory algorithms, e.g. deep neural networks, in computer vision relies on the assumption that labels provide the required level of semantic description for the task at hand. For example, in object recognition <cit.>, image-level labels are sufficient to identify generalizable patterns for each category, whereas in instance segmentation <cit.>, pixel-level annotations are required to produce detailed segmentation masks. However, in real-world applications, we are required to design effective models under weakly supervised settings. This is highly prevalent in medical image analysis <cit.>, e.g. computational pathology, wherein an image is typically described by an overall diagnostic label, though patients with similar diagnosis can present vastly different signatures in their diagnostic images. Furthermore, annotating medical images is very expensive due to the required expertise of the clinicians, thus limiting the availability of labeled data <cit.>.

Consequently, weakly supervised image segmentation methods have gained significant research interest <cit.>, and the most successful approaches typically view filters in convolutional networks as object detectors and aggregate deep feature maps to infer class-aware visual evidence <cit.>. However, medical diagnosis presents unique challenges when compared to conventional object recognition tasks. More specifically, the factors leading to a diagnosis are not well-localized and are based on observing the co-occurrence of seemingly unrelated patterns in different parts of the image, thus making it challenging to infer generalizable features. As a result, recent approaches have explored the use of multiple instance learning (MIL) <cit.>, wherein each sample is represented as a bag of instances with the assumption that only the bag-level labels are available. At their core, MIL methods attempt to aggregate features from the instances, while exploiting correlations between them, to produce an effective statistical descriptor. Given the complex nature of clinical decision process, more recent MIL methods have also included interpretability as an additional design objective. For example, Ilse et. al. include a learnable attention module in MIL to automatically identify key instances in a bag that are the most likely to trigger the observed bag-label <cit.>.

Proposed Work. In this paper, we develop a novel approach to generate dense labels for clinical images using only weakly supervised data. To this end, we represent each image as a bag of patches and adopt an MIL formulation for predicting the bag-level diagnostic label. Given the strong dependence of MIL methods on the average number of instances in bags used for training, we propose to incorporate regularization based on virtual adversarial training (VAT). In general, VAT optimizes for the network to achieve information invariance under arbitrary perturbations to the input data <cit.>. The form of perturbation we utilize is designed specifically for MIL – in addition to corrupting each of the instances, we employ perturbations to the bag, namely pruning instances and including uncorrelated noise instances. We demonstrate that the proposed VAT based regularization leads to highly robust predictive models when compared to existing approaches, particularly when the training data sizes are small. More importantly, we find this regularization to be crucial for improving instance-level predictions of an MIL model.



Since we assume no access to the instance-level labels, we propose to utilize knowledge distillation to leverage the pre-trained MIL model to design an effective instance-level label generator. In general, knowledge distillation (KD) involves transferring from one machine learning model (teacher) to another (student) <cit.>, such that performance on the task under consideration improves, or the number of parameters required for solving a task reduces. In its classical formulation, the teacher is a high-capacity model with high performance, while the student is designed to be more compact. However, several recent works have demonstrated KD to be very effective in transferring to high-capacity student models <cit.>. In this work, we view knowledge distillation from a different perspective by identifying what parts of the teacher's expertise (bag-level prediction) can be trusted while training the student model that can make robust predictions for single instances, i.e., bags of size 1. We introduce a novel formulation that jointly distills from bag-level and instance-level predictions of the teacher to produce highly effective instance label generators, using only weakly supervised data. To the best of our knowledge, this is the first known approach for using distillation to repurpose MIL models for instance labeling. 



Using empirical studies on colon cancer and breast cancer detection from histopathological images, we demonstrate significant improvements to instance-level labeling quality, when compared to the state-of-the-art MIL technique in <cit.>. Interestingly, we find that the proposed VAT regularization leads to superior results on these challenging benchmark problems over existing MIL approaches, particularly in terms of instance-level prediction. Furthermore, incorporating our knowledge distillation strategy resulted in additional performance gains. Notably, our method provides improvements of 10% and 37% on the instance labeling accuracy for colon and breast cancer datasets respectively. In summary, we show that distillation can be an effective strategy for automatically generating dense labels, which can make models interpretable for clinical practice, and can support subsequent training of dense segmentation models without the need for dense annotations. 






§ PROBLEM SETUP

Following the formulation of multiple instance learning, we consider each sample to be a bag of instances, X = {𝐱_1, ⋯, 𝐱_K}, with no specific dependency or ordering between them. Note that, in our setup, each instance 𝐱_k corresponds to an image patch and the number of instances K can vary between bags. The target variable Y ∈{0,1} corresponds to the label for a bag, whereas each y_k ∈{0,1} denotes the label for each of the instance. Since our approach is weakly supervised, we assume there is no access to the instance-level labels during training. The goal is to build a teacher model 𝒯 based on MIL to perform bag-level prediction, and subsequently employ knowledge distillation to train an identical student model 𝒮 that can produce predictions for both Y and {y_k}. Since the predictions in MIL should be invariant to the permutations of the instance order in the bags, we consider prediction functions of the following form.

A prediction function for a set of instances X, ℱ(X) ∈ℝ is permutation-invariant to the elements in X, iff, it can be expressed as follows:

    ℱ(X) = g(∑_k f(𝐱_k)),
where f and g are appropriate transformations. 
Note that, this universal decomposition can be replaced by approximations including the max operation in lieu of the summation in the above theorem. Since we employ neural networks to process the raw data, the above theorem can be modified to operate with the latent features {𝐡_k ∈ℝ^d} instead of {𝐱_k}, where Φ: 𝐱_k ↦𝐡_k denotes the mapping learned by the network. In that case, the transformation f is simplified to identity and the transformation g: ℝ^d ↦ℝ maps from the d-dimensional latent space to the target Y.



§ PROPOSED APPROACH

In this section, we describe the proposed methodology for building an effective instance label generator using only weakly supervised data. An overview of our approach can be found in Figure <ref>.



 §.§ Teacher Model – Multiple Instance Learning

The teacher model is designed to predict the bag-level target Y using the set of instances X using MIL. Our MIL formulation is similar to the one found in <cit.>, wherein an embedding-level aggregation strategy is used to perform bag classification. As shown in Figure <ref>(a), each of the instances in the input bag is processed using a convolutional neural network. The resulting features for each of the instances are then aggregated using a permutation-invariant pooling strategy before invoking the classifier module. Though the pooling can be carried out using simple strategies such as instance average or instance max, they are not directly trainable. Instead, we perform a weighted average of instance features, where the weights are determined using an attention module implemented as a simple neural network. Further, we include a constraint that the weights must sum to 1, in order to ensure that the aggregation can be applied to bags of varying sizes. 

Denoting the bag of features by H = {𝐡_1, ⋯, 𝐡_K}, the aggregation strategy can be formally stated as

    𝐳 = ∑_k a_k 𝐡_k,
where the computation of weights a_k is parameterized using a gated attention mechanism:

    a_k = exp(𝐰^T (tanh(𝐕𝐡_k^T) ⊙sigm(𝐔𝐡_k^T)  ))/∑_j=1^K exp(𝐰^T (tanh(𝐕𝐡_j^T) ⊙sigm(𝐔𝐡_j^T)  )).
Here, 𝐰∈ℝ^L × 1, 𝐔∈ℝ^L × d, 𝐕∈ℝ^L × d are learnable parameters of the attention module. Note that, the attention computation is posed as a softmax function such that the constraint of weights summing to 1 is satisfied. Finally, by using a combination of tanh and sigm activations enables both the inference of non-linear relations between instances and more importantly removes the troublesome linearity in the tanh(.) function. Note, the teacher model is trained using the cross entropy loss and optimized to maximize prediction performance on target variable Y.



 §.§ Virtual Adversarial Training for MIL

Though attention based aggregation can be superior to non-trainable pooling strategies, it is more prone to overfitting, particularly when the number of bags N, or the number of instances in each bag K are low. This limitation can be particularly severe when we utilize a pre-trained MIL model to produce instance-level labels by inputting bags with a single instance. Hence, we propose to incorporate virtual adversarial training based regularization (VAT) to promote robustness with respect to arbitrary perturbations of the bags. VAT strategies have been successfully utilized in supervised and semi-supervised learning formulations <cit.>, wherein locally-Lipschitz constraint is incorporated by enforcing classifier consistency around the norm-ball neighborhood of each sample. 

In the context of MIL, we propose to enforce three consistency conditions for the teacher model: (i) 𝒯 must produce consistent predictions even when uncorrelated noise instances are included; (ii) 𝒯 must produce consistent predictions when each instance in a bag is perturbed around its norm-ball neighborhood; and (iii) the conditional entropy of predictions from 𝒯 must be low even when a random subset of instances are arbitrarily excluded from a bag. Hence the overall loss function for the proposed MIL can be written as:

    ℒ(𝒯)    = λ_cℒ_c(Y, 𝒯(X)) + λ_nℒ_n(𝒯(X), 𝒯(X_n))  
        + λ_δℒ_δ(𝒯(X), 𝒯(X_δ)) + λ_eℒ_e(𝒯(X̅)).
Here, X is a training bag with K instances. Now, X_n denotes a modified bag with K_n > K instances that includes K_n - K uncorrelated noise instances, i.e.,

    X_n =  {𝐱^n_k}_k = 1^K_n,  where 𝐱^n_k = 𝐱_k,    if k ≤ K 
    𝐧̃_k,    otherwise.
Here, 𝐧̃_k corresponds to an uncorrelated noise instance drawn from a uniform random distribution defined in the same range as the instances in the training data. Next, in eq. (<ref>), X_δ is obtained by perturbing each instance in X within a norm ball of radius δ:

    X_δ =  {𝐱^δ_k}_k = 1^K,  where 𝐱^δ_k = 𝐱_k + δ̃,
where δ̃ denotes a random perturbation within the norm ball around 𝐱_k. Finally X̅, containing K̅ < K, instances is obtained by excluding a random subset of instances from X:

    X̅ =  {𝐱̅_k}_k = 1^K̅,  where , 𝐱̅_k =  𝐱_ℐ(k),
where ℐ denotes a randomly selected subset of indices of instances from the bag X.

While the three loss functions ℒ_c, ℒ_n and ℒ_δ are implemented using the binary cross entropy function, the final term ℒ_e uses the conditional entropy of the output probabilities. Note, minimizing the conditional entropy ensures that the output probabilities from the model is concentrated around one of the classes. The choice of the hyper-parameters for this optimization are discussed in the experiments section.





Effect of VAT. In order to understand the usefulness of including VAT into the MIL training process, we setup an empirical study with the MNIST handwritten digits data, similar to <cit.>. A bag is composed of a random number of images from the MNIST dataset, and is assigned a positive label if it contains one or more images of digit 9. The number of instances in a bag is Gaussian-distributed with mean K (closest integer value is taken) and variance 5. We study the effect of VAT by varying the number of bags N = 50, 75, 100, 200, 500 and the average number of instances per bag K = 10, 20 respectively. We used a fixed set of 1000 bags for validating the resulting models from each of the cases. All experiments were run with the LeNet5 architecture, trained using the RMSprop optimizer and the area under the ROC (receiver operating characteristic) curve is used as the evaluation metric. Figure <ref> shows the bag-level prediction performance on the validation set for the different cases. As it can be observed, the proposed VAT regularization leads to significant performance improvements for varying bag sizes, particularly when N is low, thus resulting in highly consistent predictive models.




 §.§ Student Model – Instance Label Generation

Since we do not have access to ground truth labels for training the instance-level classifier, we propose to leverage knowledge from the teacher model, i.e. bag-level classifier, using a knowledge distillation approach. More specifically, we build a student model 𝒮 that has an architecture similar to the teacher, but with the goal of improving its prediction quality for the instances. An interesting aspect of the proposed formulation is that we do not need require a separate predictor for the instance-level, since a single instance can be represented as a bag of size 1. Following our notations defined earlier, for a given bag comprising the instances X, we denote the features obtained using the teacher and student models as H^t and H^s respectively. Given the latent representations both the teacher and student models, we perform aggregation using the attention module and employ an output linear layer to produce the logits, followed by the softmax function to obtain the probability of assignment for each of the classes.










Formally, for an input X, the teacher model produces the output P^t = (z^t), where the aggregated representation z^t is obtained using eq. (<ref>). Similarly, the student 𝒮 produces the output P^s = (z^s). In the original formulation of knowledge distillation <cit.>, the student is trained such that its output P^s is similar to the teacher’s output P^t, as well as to the true labels, in order to improve the bag-level classification performance. In practice, the output probability of the teacher is smoothed with a temperature τ to soften the estimate, and provide additional information about the challenges during training.

    P^t_τ = (z^t/τ), P^s_τ = (z^s/τ).
However, in our setup, the goal is not improve the bag-level classification, but instead the instance-level prediction, without accessing ground truth labels entirely. To this end, we propose this optimization objective:

    ℒ(𝒮) =    γ_cℒ_c(Y, P^s) + γ_bℋ(P^t_τ,P^s_τ)
    
        + γ_i∑_k = 1^K ℋ(P^k, t_τ,P^k, s_τ) + γ_e ∑_k =1^K L_e(P^k, s).
Here, P^k, s denotes the output from 𝒮 for the k^th instance in X, and ℋ is the KL-divergence between two Bernoulli variables:

    ℋ(p,q) = p logp/q + (1-p) log(1-p)/(1-q).
In the above objective, the first term denotes the binary cross entropy between the predicted bag-level labels and the ground truth, while the second term performs distillation from 𝒯 to 𝒮 using the softened softmax probabilities. The last two terms are based on the instance-level predictions obtained by passing each instance (𝐱_k) independently through the teacher and the student models. Similar to the formulation in eq. (<ref>), L_e denotes the conditional entropy. Through this controlled knowledge distillation at bag and instance levels, we show that our approach achieves significant gains in instance-level prediction even without accessing supervisory labels.








§ EXPERIMENTS

In this section, we describe the two applications considered, discuss the experiment setup, and present a detailed performance evaluation. All experiments were carried based on a standard convolutional neural network comprising a stack of convolution layers with ReLU activation followed by max pooling, and 3 fully connected layers, while the classifier contains a single fully connected layer. For comparison, we consider the state-of-the-art baseline <cit.>, that employs attention-based aggregation to perform MIL[Implementation for attention-based MIL was obtained from a. <https://github.com/utayao/Atten_Deep_MIL> and b. <https://github.com/AMLab-Amsterdam/AttentionDeepMIL>.]. All models were implemented using PyTorch <cit.>.  



 §.§ Dataset Description

We tested our algorithm on cancer histopathology datasets of the breast and colon. Histopathology images are especially relevant because the nucleus identification of diseased cells is a highly specialized and time-consuming task. Consequently, it would be hugely beneficial if the relevant instances of tumorous patches could be identified accurately, which would in turn greatly reduce the burden on clinicians. 



  §.§.§ Color Cancer Dataset

This dataset is comprised of 100 Hematoxylin and eosin stain (H&E) histopathology (500 × 500 pixels) images of colorectal cancer <cit.>. Out of the 29,756 nuclei centers identified, 22,444 nuclei were given an associated class label, i.e. epithelial, inflammatory, fibroblast, and miscellaneous. To simplify our problem for the multiple instance learning we chose to focus on the binary problem of detecting the epithelial cell nucleus. This is motivated by the findings in <cit.> that mutations expressed in the epithelial cells of the colon are often the starting point for cancerous mutation. In this case, each whole slide image (bag) was divided into 27 × 27 image patches (instances) (See Fig. <ref> for examples). Every bag containing epithelial cells were marked as positive. Further, the ground truth labels for instances, i.e. patches, were formed by studying if the instance contained epithelial nuclei. Note, these instance labels were used only for evaluation and not utilized during training. 



  §.§.§ Breast Cancer Dataset

This dataset consists of 58 H&E stained histopathology images (896 × 768 pixels) <cit.> with each of the cells marked as benign or malignant. Further, each whole slide cell image (bag) is also assigned a  positive label if it contained malignant cancer cells (instances). Similar to the previous case, the images were divided into 32 × 32 patches to form the instances (See Fig. <ref> for examples of both). Note, with those instances with 75% or more of white pixels were considered as background and discarded from our study. 

Both experiments were carried out on a train/valid/test split of 70/10/20 with 5-fold cross validation.The number of convolution layers in the feature extractor part of the network was fixed at 2 for the colon cancer dataset and at 5 for the breast cancer dataset. We used the Adam optimizer with learning rate set to 1e-4 and used batch size 1. The hyper-parameters for the student model training in  eq. (<ref>) were set at the following values for both cases: γ_c = 0.3, γ_b = 0.5, γ_i = 0.5, γ_e = 0.1. On the other hand the hyper-parameters for teacher model training in eq. (<ref>) were tuned specifically for the two datasets. This was because the breast cancer dataset presented a severe class imbalance (benign vs malignant) at the instance-level. More specifically, for the colon cancer dataset, we used the values λ_c = 1.0 , λ_n = 0.5,  λ_δ = 0.3, λ_e = 0.3, whereas for the latter λ_c = 0.8 , λ_n = 0.8,  λ_δ = 0.3, λ_e = 0.3. Furthermore, for the breast cancer case, it was beneficial to include multiple random realizations (set to 5) of X̅ for the VAT regularization in eq. (<ref>). In other words the loss term L_e was constructed by averaging the conditional entropy obtained using bags containing different subsets of instances. 




 §.§ Results

Tables <ref> and <ref> present the cross validated results for the two datasets on the instance-level label generation. As mentioned earlier, we report the results for the state-of-the-art MIL method in <cit.>, the teacher and student models from the proposed approach. For evaluation, we adopted the widely adopted metrics, accuracy, F1 score and area under the receiver operating curves (AUROC). The first striking observation is that the proposed approach consistently produces significant performance gains, in terms of all three metrics, over the baseline method. For example, on the colon cancer dataset, our approach provides improvements of 10% in accuracy and 0.19 in F1 score. More interestingly, with the challenging breast cancer dataset, we find that the baseline MIL performs poorly than even random predictions. In contrast, the proposed strategies lead to more reliable predictions, producing a boost of 37% in the prediction accuracy score. This clearly evidences the effectiveness of the VAT regularization and our novel distillation formulation, in the context of multiple instance learning, towards generating dense labels from weak supervision.









§ CONCLUSIONS

In this paper we presented a method for producing instance-level labels with only weak supervision, i.e. image-level labels, in medical image analysis. Our method relies on using a novel virtual adversarial training regularization to MIL and repurposing a pre-trained MIL model for instance classification. Through empirical validation on two very challenging histopathology cancers of the colon and the breast, we showed that the proposed method consistently outperformed the state-of-the-art MIL. This presents a huge opportunity to save exhaustive efforts in annotating clinical data, and to more importantly enable weakly supervised data augmentation for data-driven inferencing. Future work will include extending this methodology to multi-class predictions, and developing scalable techniques to produce pixel-level segmentation.






IEEEbib


