Explanation-based Data Augmentation for Image Classification

1 Introduction . Machine learning models learn decision boundaries based on the training dataset . Ideally , a training dataset should provide sufficient variations in each class so that the model can learn the correct decision boundaries . However , when there are under-represented regions in the training dataset , the model will learn sub-optimal decision boundaries , leading to misclassification of data points [ 1 , 2 ] . One way to address this problem is to augment the training dataset . A common data augmentation approach is to apply different transformations to the training samples [ 3 ] or to mix existing samples [ 4 , 5 ] . However , such data augmentations only explore the neighborhood of these samples and may not cover the under-represented regions . Another approach is to use annotations such as part landmarks to obtain images from image resources such as Flickr or Google [ 6 ] . This approach may introduce out-of-distribution images and degrade the classifier performance . Identifying the appropriate samples to add to the training dataset is crucial . Here , we propose to use model decision explanations to facilitate the search for samples from image repositories and augment the training dataset with samples from the under-represented regions to enable the model to learn the correct decision boundaries . Figure 1a shows the image of a juvenile Black Tern that has been misclassified as White Breasted Nuthatch . A closer examination of the training dataset reveals that it contains very few images of juvenile Black Terns ( 5 out of 30 images ) . These juvenile birds have white heads with black skullcap and black earmark , unlike the adult Black Terns [ 7 ] ( see Figure 1b ) . In fact , the juvenile Black Tern in Figure 1a is more similar to White Breasted Nuthatch as shown in Figure 1c , leading to the misclassification . Clearly , there is a need to augment the training data to include more images of juvenile Black Tern in order to learn the correct decision boundary between Black Terns and White Breasted Nuthatch . Methods to explain model decisions include pixel-level attributions [ 8 , 9 , 10 ] , and high-level semantic concepts such as coarse-grained saliency maps [ 11 , 12 ] , interpretable basis decomposition [ 13 ] , linguistic explanations [ 14 , 15 ] and prototypes [ 16 ] . The work in [ 17 ] designs a Comprehensive 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . Convolutional Neural Network called CCNN that explains the model decision in terms of word phrases , e.g. , the bird in Figure 1a is classified as White Breasted Nuthatch due to the concepts ’ white breast ’ , ’ white belly ’ , ’ long beak ’ . This paper introduces a framework called BRACE ( BetteR Accuracy from Concept-based Explanation ) , which utilizes concept-based explanations to identify candidate samples from image repositories for data augmentation . The key idea is to identify concepts that have led to misclassifications and augment the dataset with images that contain these concepts . We design a utility function that computes the degree of match between the visual features in an image and the set of concepts in the under-represented regions . The proposed approach enables us to select samples with high utility scores and increase the representativeness of the training dataset . Experiment results on multiple datasets demonstrate that BRACE outperforms state-of-the-art augmentation methods . 2 Related Work . Data augmentation is a widely used pre-processing step in training deep neural networks . The objective is to inflate the training dataset with label preserving small transformations to avoid overfitting . Techniques include geometric transformations , color space augmentations , kernel filters , mixing images , feature space augmentation , adversarial training , generative adversarial networks , neural style transfer , and meta-learning [ 3 ] . However , these augmentation methods only explore the neighborhood of existing images and are not able to add samples from under-represented regions [ 18 ] . The work in [ 6 ] taps into the large online image repositories to augment the training dataset . Object bounding boxes and part landmarks annotations in the original dataset are used to select relevant and diverse images . Since the images retrieved are typically noisy , [ 19 ] trains two models , to select in-distribution samples and to re-label the noisy images in the selected set . Both these works may not increase the representativeness of the dataset as they do not consider the under-represented regions in the dataset when deciding which samples to add . Existing explanation methods for deep neural network based image classifiers include pixel-level attribution methods and high-level semantic explanation methods . Pixel-level attribution methods [ 8 , 9 , 10 ] assign an importance score to each pixel in the image based on the contribution of that pixel towards the model decision . On the other hand , semantic explanation methods explain model decisions in terms of human-friendly concepts and can be categorized into post-hoc methods versus fully interpretable classifiers . Post-hoc methods include Grad-CAM [ 11 ] , FLEX [ 15 ] , IBD [ 13 ] , TCAV [ 20 ] , and ACE [ 21 ] . The first three approaches are image-level explanation mechanisms explaining the model ’ s prediction of the given input . In contrast , TCAV and ACE are class-level explanation mechanisms that explain the characteristics of the entire class . Fully interpretable classifiers such as ProtoPNet [ 16 ] and CCNN [ 17 ] explain model decisions in terms of prototypical parts and word phrases , respectively . The proposed BRACE framework is able to utilize explanations from both post-hoc methods and fully interpretable classifiers to obtain new samples for data augmentation . 3 Proposed Framework . Machine learning models often make wrong classifications for classes that have insufficient variance in training data . Adding more diverse samples to the mix will enable the model to improve its accuracy . Intuitively , we want to give more training samples to classes with higher misclassifications so that the model is able to learn the real-world variations . Let C be the set of class labels , and D = { ( xi , yi ) } be the original training set , where yi ∈ C is the class label of image xi . For each class c ∈ C , we want to augment D with a set of new samples that is proportional to the number of misclassifications for that class . Given a deep neural network model M , we compute the ratio of misclassifications rc for class c on the validation set Dv as follows : rc = 1− ∑ ( x , c ) ∈Dv I ( M ( x ) = c ) m ( 1 ) where m is the number of validation samples with class label c , and I is a function that returns 1 when its argument is true and 0 otherwise . We will augmentD with |Dc|×rc number of new samples where Dc ⊂ D is the set of images with class label c. Let Xc be the set of samples obtained using class c as the keyword query on image repositories . This set is typically noisy , which may degrade model performance . As such , we will assess whether the new image is in the under-represented region and whether it contains concepts that led to the misclassification . We say that x is an under-represented sample if it has visual features of class c , but the model ’ s confidence that x belongs to a different class c̄ 6= c is high . We compute the under-representation score as follows : β ( x , c , c̄ ) = fx.fc ‖fx‖‖fc‖ × eP ( c̄|x ) ( 2 ) where fx is the feature vector of x and fc is the average feature vector of all the images in class c , P ( c̄|x ) is the predicted probability of x belonging to class c̄ . Feature vectors are extracted from model M . A high β value indicates that x is similar to some images in class c , but the model has classified it as class c̄ . Such samples are more informative , and using them for training may help M generalize better . Further , the sample x should not only possess features of class c but should also contain specific concepts that caused the model M to misclassify it as class c̄ . Adding images with these specific concepts will help the model to better differentiate class c from class c̄ . Let Sc→c̄ be the set of concepts that caused M to misclassify images of class c into c̄ , and C̄ = ⋃ c̄ . Let ∆ ( Sc→c̄ , x ) be the function that computes the degree of match between the visual features in an image x and the concepts in Sc→c̄ . The derivation of Sc→c̄ and ∆ ( . ) differ depending on the explanation mechanism used ( see Section 4 ) . The utility score of a sample x is computed as follows : utility ( x ) = ∑ c̄∈C̄ [ β ( x , c , c̄ ) ×∆ ( Sc→c̄ , x ) ) ] ( 3 ) Then |Dc| × rc samples with the highest utility scores are added to the original train dataset . We repeat this process for all the classes in D. We fine-tune the weights of M with the augmented training dataset . Note that adding new samples may result in data imbalance , and this is resolved by using weighted cross-entropy loss during fine-tuning where the weight of class c is given by 1 |Dc| ( 1+rc ) . With this , there will be minimal change to the weights of the classes where M already performs well . Algorithm 1 gives the details of the BRACE framework . 4 Derivation of Sc→c̄ and ∆ ( . ) . In this section , we describe how we derive the concepts that cause the misclassification , Sc→c̄ , for two popular explanation mechanisms : the fully interpretable classifier with linguistic explanation and the black-box classifier with post-hoc explanation using heat maps . We also show how to compute the degree of match ∆ ( . ) in these cases . 4.1 Fully Interpretable Classifier with Linguistic Explanation . The work in [ 17 ] introduces an additional concept layer to the CNN-based architecture to guide the learning of the associations between visual features and word phrases extracted from image descriptions . This Comprehensible Convolutional Neural Network ( CCNN ) explains its decisions in word phrases corresponding to different visual concepts . The training objective function considers concept uniqueness which encourages each learned concept to correspond to only one word phrase , and mapping consistency which aims to preserve the distance between the learned concept and its corresponding word phrase in a joint embedding space . Together with classification accuracy loss , CCNN is currently the state-of-the-art fully interpretable classifier . Here , we discuss how the proposed BRACE framework can further improve CCNN classification accuracy . Algorithm 1 : BRACE input : Classification model M , Original training dataset D , Set of class labels C output : Fine-tuned weights θ θ ←Weight initialization. . Initialize θ with pre-trained weights of M for iter ∈ [ 0 , max_iterations ] do D′ ← D for c ∈ C do rc ← Calculate miss-classification ratio as in Eq . 1 . Xc ← Obtain images given the class name of c as the query term . for x ∈ Xc do for c̄ ∈ C̄ do β ( x , c , c̄ ) ← Calculate under-representation score as in Eq . 2 . Sc→c̄ ← Derive concepts caused misclassifications . ∆ ( Sc→c̄ , x ) ← Calculate availability of concepts Sc→c̄ . end utility ( x ) = ∑ c̄∈C̄ [ β ( x , c , c̄ ) ×∆ ( Sc→c̄ , x ) ) ] end D′ ← D′ ⋃ { |Dc| × rc samples with the highest utility scores } end θ ← finetune_weights ( M , D′ ) end Let V = { v1 , ... , vn } be the set of visual features extracted by the concept layer of CCNN for an image x . Each vi ∈ V corresponds to a concept described by a word phrase p ∈ P = { p1 , ... , pn } . CCNN employs a Global Average Pooling ( GAP ) layer to express its classification decision as a weighted sum of the learned concepts . Suppose the output of the GAP layer is { o1 , ... , on } where oi corresponds to concept i in x . Then the contribution of i to the class decision c is given by oi × wi , c ∈W , where W ∈ Rn×C is the weight matrix of the fully connected layer in CCNN . We apply the softmax function to obtain the percentage contributions and select the set of concepts whose contribution is greater than some threshold . We will take the top-5 if there are more than five concepts that satisfy the criteria . Here , we set the threshold to be 1n . For instance , CCNN classifies the bird in Figure 2 as Nashville Warbler and explains that the concepts `` Yellow breast '' , `` Grey crown '' and `` White eyering '' accounted for 47 % , 19 % , and 14 % of the decision , respectively . Given Xc→c̄ , the set of images with class label c that have been misclassified as c̄ , we compute the number of images in Xc→c̄ that contains the concept i . The top k concepts with the highest number form the set Sc→c̄ . We set k = 3 in our experiments . Recall , each visual feature vi in CCNN concept layer is mapped to a word phrase pi describing a concept , and vi is activated only when the concept occurs in the image . As such , given the set of concepts Sc→c̄ , we utilize their corresponding visual feature activations to determine the degree of match of a concept i in an image x as follows : αi = − log [ 1− 1 1 + e−ōi + ] ( 4 ) where ōi is the normalized oi obtained by subtracting the mean activation of the GAP layer . The negative log function gives more weight to an image with one highly activated concept than one with multiple weakly activated concepts . With this , the degree of match between the set Sc→c̄ and image x is given by : ∆ ( Sc→c̄ , x ) = k∑ i=1 αi ( 5 )

Summary: This paper proposed a utility function to rank new training samples with respect to their potential contributions of improving the model performance. The proposed utility contains two parts, one is for the under-represented region, another is based on explanation algorithms for finding the concepts that cause the misclassification. Experiments proved the effectiveness of the proposed method.