{'fraction_non_alphanumeric': 0.03485356661249611, 'fraction_numerical': 0.016389474776114243, 'mean_word_length': 4.931501230516817, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Learning Structure and Strength of CNN Filters for Small Sample Size Training

Convolutional Neural Networks have provided state-of-the-art results in several computer vision problems. However, due to a large number of parameters in CNNs, they require a large number of training samples which is a limiting factor for small sample size problems. To address this limitation, we propose SSF-CNN which focuses on learning the structure and strength of filters. The structure of the filter is initialized using a dictionary-based filter learning algorithm and the strength of the filter is learned using the small sample training data. The architecture provides the flexibility of training with both small and large training databases and yields good accuracies even with small size training data. The effectiveness of the algorithm is first demonstrated on MNIST, CIFAR10, and NORB databases, with a varying number of training samples. The results show that SSF-CNN significantly reduces the number of parameters required for training while providing high accuracies the test databases. On small sample size problems such as newborn face recognition and Omniglot, it yields state-of-the-art results. Specifically, on the IIITD Newborn Face Database, the results demonstrate improvement in rank-1 identification accuracy by at least 10%.


Introduction
Convolutional Neural Network (CNN) is a multilayer representation learning architecture which has received immense success in multiple applications such as object classification, image segmentation, and natural language processing. From LeNet [25] to AlexNet [23], GoogleNet [39], VGG-Net [38], ResNet [17], and now DenseNet [18], given large training data, CNNs have shown state-of-the-art performance for several applications. However, large training data is also a limiting requirement for applications with small sample size and many of these architectures easily overfit on small training samples. For example, as shown in Figure 1, a face recognition model trained on large training data of adult faces (e.g. CelebA or LFW databases) may not provide good performance when tested for newborn face recognition [2,3]. In newborn face recognition, the available training data may be small and therefore, even after fine-tuning, standard deep learning based face recognition models may not yield high performance.
To address the challenge of small sample size, researchers have proposed algorithms focusing on CNN initialization tricks and modifications to CNN architecture. Erhan et al. [9] have investigated the importance of unsupervised pre-training of deep architecture and empirically shown that pre-trained weights of the network generalize better than randomly initialized weights. Similarly, Mishkin and Matas [32] have proposed Layer-Sequential Unit-Variance (LSUV) initialization that utilizes the orthonormal matrices to initialize the weights of each convolutional layer and normalize the weight to the unit variance. Along the same lines, pre-defined handcrafted filters are also proposed to handle the small sample size problem. For example, Andén and Mallat [1] propose Scattering network (ScatNet) which is a CNN like architecture where pre-defined Morlet filter bank is utilized to extract features. However, these handcrafted filters may not represent the true distribution of the data and hence extract notso-meaningful features. To overcome this limitation, Oyallon et. al. [35] have proposed hybrid network, where they have utilized ScatNet feature followed by CNN architecture. Similarly, Chan et. al. [4] propose PCANet architecture that utilizes Principal Component Analysis (PCA) to learn the filter banks. They also present an extension, termed as LDANet, in which the selection of the cascade filters are trained from Linear Discriminant Analysis (LDA). Gan et al. [12] propose a PCA-based Convolutional Network (PCN) which has the influence of both CNN [20] and PCANet [4]. Dan et al. [45] utilize the concept of kernel PCA to further improve the PCANet architecture. Zeng et al. [49] propose a multilinear discriminant analysis network (MLDANet) which is a variant of PCANet and LDANet. Feng et al. [11] propose Discriminative Locality Alignment Network (DLANet) which is based on manifold learning. These architectures learn filters in stack-wise manner, and once the network (filters) is trained, generally, it is not allowed to fine-tune the filters on other databases.
In other research directions for small sample size training, Mao et al. [31] propose a neural network learning method based on posterior probability (PPNN) to improve the accuracy. Ngiam et al. [34] propose tied weights in a filter using tiling parameter which handles the total number of learning parameters. In another work, Indian Buffet Process (IBP) priors are utilized to propose semi-supervised ibpCNN which shows better generalizability [10]. Xiong et al. [47] propose Structured Decorrelation Constrained (SDC) for hidden layers. The authors have also proposed a novel approach termed as Regularized Convolutional Layers (Reg-Conv) that can help SDC to regularize the complex convolutional layers. Similarly, Cogswell et al. [5] propose DeConv loss for CNN architecture that helps in training small databases.
One of the major problems with adapting pre-trained CNN models for small sample size problems, as mentioned previously, is large amount of parameters; therefore, insufficient training samples may cause overfitting. If we reduce these parameters to a significantly small number, then the problem can be addressed in a better way. This paper focuses on two novel ways to develop CNN based feature representation algorithm for small sample size problems: (i) associating "strength" parameter to control the effect of each pre-trained filter, and (ii) utilizing a generalizable approach that pre-learns the "structure" of the filters using small training samples. The proposed architecture is motivated from ScatNet but in place of pre-defined filters, we utilize dictionary learning model to pre-learn the filters. Further, unlike CNN approaches where we update the weights in every iteration, we introduce strength of the filter and update only the strength parameter not the filters. The introduction of "strength" of filters significantly reduces the number of parameters to learn (detailed calculations shown later) and therefore avoids overfitting with limited training. Experiments are performed on object classification databases, MNIST [26], CIFAR-10 [22], NORB [27], Omniglot [24], and a challenging small sample size database of newborn faces [3]. Comparison with existing algorithms show that the proposed approach achieves state-of-the-art performance for small sample size problems and significantly reduces the number of parameters to learn/fine-tune.

Proposed SSF-CNN
It is difficult to learn the entire network from scratch while training with small size databases. Existing approaches with pre-defined or handcrafted filters [1], and pre-trained filters [4,12,49], may not allow fine-tuning the filters and therefore, the learned model may not represent the true data distribution for small sample size problems. To mitigate these challenges, we propose a novel approach, termed as Structure and Strength Filtered CNN (SSF-CNN), which has two components: (i) structure of the filter and (ii) strength of the filter. It is our hypothesis that structure of the CNN filters can be learned from either domain specific larger databases or from other representation learning paradigms that require less training data for instance, dictionary learning [40,41]. It is well known that matrix factorization or dictionary learning allows us to learn the dictionary that helps encoding the representative features. If we represent CNN filters using dictionary, it can provide the "structure"; however, it may not be well optimized for the classification task. Therefore, the next part of the framework is computing "strength" of every filter to adapt the weights of these filters according to the data characteristics. Strength can be interpreted as the attuning parameter to update or adapt the filters based on the small size training data. For illustration, columns (a) to (d) in Figure 2 represent the samples from trained dictionary filters for the MNIST database and columns (e) to (h) represent the updated filters where changes are due to the strength parameter.
Formally, in the proposed approach, first the hierarchical dictionary filters are learned to initialize the CNN, followed by learning the strength parameter to train the CNN model. We introduce strength parameter 't' for the CNN filters 'W' which allows the network to assign weight for each filter based on its structural importance. In CNN model,   strength and structural parameters t and W can be learned in two ways: 1) pre-train W, use it in CNN by freezing the values of W followed by learning the strength t, and 2) pre-train W which is used to initialize the CNN model followed by learning t and W iteratively. While the second approach which simultaneously learns both structure and strength may be desirable, the first approach requires very few parameters to be trained in CNN model. We next describe the approach to hierarchically learn W, filters of CNN model, using dictionary learning followed by learning the strength parameter t.

Learning Structure of Filters
In this research, we propose to use dictionary learning algorithm for learning the structure of the filters. The algorithm can be divided into two steps: 1) learn hierarchical dictionary filters and utilize trained dictionary filters to initialize the CNN, and (2) train CNN with dictionary initialized filters.
Hierarchical Dictionary Filter Learning: Dictionary learning focuses on learning a sparse representation of the input data in the form of a linear combination of basic ele-Algorithm 1 Hierarchical Dictionary Filter Learning 1: Notation: N is a number of training samples, n number of extracted patches, y is a patch from Y 2: Input: X N 3: Output: D 4: for each layer l := 1 to numLayer do 5: for j := 1 to N do 10: f map j = X j * W 11: end for 12: 13: end for ments or atoms [8,29,30,40,41]. For a given input Y, a dictionary D is learned along with the coefficients α: where, the 0 -norm imposes a constraint of sparsity on the learned coefficients and τ corresponds to the maximum number of non-zero elements. Often, the 0 -norm is relaxed and the updated dictionary learning formulation can be written as: where, λ is a regularization parameter which controls the sparsity promoting 1 -norm. In this research, we utilize dictionary learning to pre-train the filters of CNN in a hierarchical manner. As shown in Algorithm 1, a hierarchical dictionary learning technique is utilized to initialize the CNN model (ResNet [17]). The trained dictionary atoms are used to convolve over the input image. After convolution, feature maps are normalized according to the activation function (e.g. ReLu) used in CNN models. Figure 3 presents the structure of a block of the SSF-ResNet architecture. The extracted feature map is an input for the next level of the hierarchical dictionary. In this manner, the number of dictionary layers is same as the number of convolutional layers in CNN models. In Algorithm 1 extractP atch function is used to tessellate the input image into small patches. The trained dictionary is organized in the two-dimensional array where each filter is arranged in one column. These learned filters are reshaped and convolved over the input image to produce the feature maps for the next level of the dictionary.
Training CNN with Dictionary Initialized Filters: Typically, CNN has multiple convolutional layers, each layer has multiple filters, and these filters are trained using stochastic gradient descent (SGD) [28]. For input X and convolutional filter W, the convolutional function of the CNN can be de- where * is the convolutional operation and b is the bias. A CNN architecture is designed by stacking multiple convolutional and pooling layers. These deep CNN architectures are trained in two passes: 1) forward pass and 2) backward pass. In the forward pass, network propagates the input signal to the last classification layer. In backward pass, the error δ l j for each layer l on node j is computed with respect to the cost and the weights of the CNN filters are updated accordingly.
Let a l be the output feature map at l th layer of the CNN with a cost function C. The weights are updated as per the gradient direction, i.e. ∆W l = ∂C ∂W l . Using chain rule, ∆W l = a l−1 δ l . In traditional CNN learning, the weights are initialized in different ways such as Xavier [13], or MSRA [16] approach and even randomly. In this research, we propose initialization of the CNN filters using dictionary learned filters as discussed above. As shown in Figure 4, filters learned from the dictionary learning technique show more "structure" than traditional approaches, particularly with small training data. While dictionary initialization helps in finding improved features, updating the filters in a traditional manner still requires large parameter space, which is not conducive for small training data. In the next subsection, we present the proposed approach of incorporating strength of the filters and not update the filters using SGD which reduces the number of learning parameters significantly.

Learning Filter Strength
The proposed concept of learning strength of the filter is illustrated in Figure 5 filters obtained from dictionary learning technique and update only the strength of the filter. As shown in Figure 5, this significantly reduces the number of learning parameters. For l th layer, the strength parameter 't l ' is learned using stochastic gradient descent method; i.e. a scalar value is learned rather than learning the complete filter. The proposed process can be written as, where, (t W) represents element-wise multiplication. The pre-trained filters learned from dictionary learning or pre-trained model are selected and the only variable to be learned is t which can be learned using SGD. Since |W| >> |t|, even small training data can be used to train the network. In literature, various regularization techniques have been utilized for better convergence. Existing regularization techniques such as dropconnect and 1 regularization can also be used while learning t.

Experimental Results
The effectiveness of the proposed algorithm is evaluated on multiple databases with state-of-the-art CNN architectures including ResNet [17] and DenseNet [18]. The details of experiments and results are described below.

Database and Experimental Protocol
Since the proposed architecture is for small size training data, the experiments are performed with varying train- ing sizes on three databases: MNIST [26], CIFAR10 [22], and NORB [27]. More specifically, as shown in Table 1, the experiments are performed with 14 data sizes, 100, 200, · · · , 1000, 2000, · · · , 5000. The proposed algorithm is also tested with the complete/standard training set.
Further, experiments are performed on an interesting and small sample size problem of newborn face recognition [3].
The newborn database has images from 96 babies and as per the predefined protocol [3], training data consists of images from 10 newborns and the remaining images, corresponding to 86 newborns, are used for testing (with 1, 2, 3, and 4 images per subject in the gallery). Finally, experiments are also performed on the Omniglot database [24] which comprises 1623 handwritten characters pertaining to 50 different alphabets. The background database has 30 alphabets and evaluation set has 20 alphabets. All the experiments are performed with five fold cross validation and average accuracies are reported in next subsections.

Implementation Details
To demonstrate the results of the proposed SSF-CNN, a popular ResNet [17] architecture is used. Figure 6 illustrates the ResNet architecture which has 1 input layer, 31 convolutional layers, 1 global pooling layer, and 1 softmax layer. The strength parameter is regularized with both Elas-ticNet [50] (λ 1 |t| 1 + λ 2 |t| 2 ) and DropConnect [43]. It is experimentally observed that in the first 20 epochs, λ 2 is 0.0001 and λ 1 is 0. After 20 epochs both the regularization constants are set to 0.0001. 1 regularization introduces sparsity in t parameters and helps to fadeout the less contributing filters thus improving the strength of filters with large contribution. Further, at every epoch, dropconnect parameter is randomly initialized by Bernoulli(pr) where pr has 0.8 and 0.2 probability for generating 1s and 0s respectively.
The proposed model utilizes a dictionary and pre-trained model to initialize and train the CNN filters. Specifically, dictionary filters are learned using K-SVD algorithm 1. These dictionaries are layered in a similar manner as CNN layers and are referred to as hierarchical dictionary. The parameter values for K-SVD such as sparsity parameter, the total number of iteration, and batch size for dictionary have been initialized with 0.1, 1000, and 100 respectively. The input signal for dictionary are patches extracted from randomly selected N number of balanced training samples.  100, 200, · · · , 1000, 2000, · · · , 5000, as shown in Table 1.

Parameter Learning
In traditional ResNet architecture, total number of parameters to be learned in convolutional layers for the CIFAR-10 dataset is 242, 352. On the other hand, in the proposed SSF-CNN, total number of strength parameters to be learned for the same database is 26, 928. This shows that the proposed architecture reduces the total number of parameters to be learned by 1/9 th factor in each convolutional layer. Similarly, for other databases and architectures, we observe reduced number of parameters to train.

Results on Limited Training Data -MNIST, CIFAR-10, and NORB
The main focus of the proposed SSF-CNN is to learn the deep neural network models with a small number of training samples. Since the proposed initialization is performed using dictionary learning, we also compute the results of shallow dictionary which serves as the baseline for all the experiments. We have also compared the proposed algorithm with PCANet [4], Deep Hybrid Network [35], ScatNet [1], ResNet initialized with Xavier [13], and ResNet initialized with MSRA [16]. For the proposed SSF-CNN, two sets of results are computed based on the manner in which the parameters W and t are learned.
• Experiment 2 -Learn t, Freeze W: Only the strength parameter t is learned while the initialized filters are not updated.
Filter Visualization: We first analyze the filters learned from the proposed method and CNN. Figure 4 shows the first and second layer filters trained on CIFAR-10 database:  Figure 4, it can be observed that dictionary trained filters have less noisy patterns compare to CNN trained filters on small data. In literature, Zeiler and Fergus [48] have also suggested that the filters that have structural properties are good while the ones with noisy, correlated, and unstructured pattern are bad. This visualization illustrates that the proposed SSF-CNN utilizes good filters. We next support these assertions with experimental results.
Performance with Shallow Dictionary: To analyze the performance of the proposed method with varying training data sizes, 14 subsets of the training data of size 100, 200, · · · , 1000, 2000, · · · , 5000, are created. These sets are used to train the dictionary and SSF-CNN on each of the three databases individually. To train shallow dictionary for each database, 50 atoms are initialized and trained with varying number of training samples. The trained dictionary is then utilized to compute sparse features for training and testing samples. These features are input to a 3 layer neural network with 2 hidden layers of size {40, 20}. The results of shallow dictionary learning on three object classification databases are reported in Figure 7. From these results, it can be inferred that shallow dictionary learning might not require large training data and increasing data may not lead to large improvement in classification results. This figure also shows that shallow dictionary learning may not be able to yield high classification accuracy and deep CNN architectures may further help.
Performance with SSF-CNN and Comparison with Ex-isting Algorithms: We next evaluate the performance of the proposed SSF-CNN on three object classification databases by varying the training data size. The results in Figure 7 show that, in general, Xavier and MSRA initialization yield lower performance compared to the proposed dictionary initialization for very small training data. It can be consistently observed that the differences in results are more profound when the strength parameter t is learned with fixed W. The results further show that the performance of the proposed SSF-CNN increases with increase in training database size. It can be inferred that unlike shallow dictionary, where the performance does not improve significantly with increase in training database size, the parameters learned by the proposed SSF-CNN evolves with large data.
We also observe that the proposed algorithm, in general yields higher performance compared to three existing algorithms, PCANet [4], Deep Hybrid Network [35], and Scat-Net [1]. We next perform the experiments when the structure of the filters are obtained from training on ImageNet data and then strength parameter is used to adapt to small sample size problem (i.e. Proposed ResNet: Pretrained on ImageNet, Learn t). Results in Figure 7 show that our hy- pothesis that the structure of filters can be learned from training on large databases and knowledge can be adapted with small training data using the strength t is valid.
Results on Complete Training Data: We have also evaluated the proposed dictionary learning based initialization method on the standard training protocols of all three databases, i.e., using the complete training data. Similar to small training data size, the experiments are performed with multiple methods of initializations and two ways of learning W and t, i.e., (i) learn W and (ii) learn t, freeze W. In this experiment, the proposed dictionary learning based initialization for ResNet is compared with Xavier and MSRA initialization. On the MNIST database, the proposed initialization yields an accuracy of 99.70% which is comparable with 99.71% achieved by standard initialization. On the NORB database, the proposed approach yields at least 3.8% higher classification accuracy compared to existing initialization approaches. It is also observed that even if the filters have random values, learning strength produces considerably high accuracies. Once the filters are trained, optimizing the strength of those filters can further improve the performance.

Small Sample Size Case Studies
To showcase the effectiveness of the proposed structure and strength concept on small sample size databases, we present two case studies (i) newborn face database [3] and (ii) Omniglot database [24]. Figure 8 shows sample images from both the databases.
Newborn Face Recognition: Bharadwaj et al. [3] have shown that newborn face recognition is a challenging small sample size application. The publicly available IIITD Newborn database [3] contains face images from 96 newborns. The pre-defined protocol limits us to use training samples from only 10 newborns and testing is performed with 86 newborns. We compute the performance of ResNet architecture where the proposed dictionary based initialization helps in estimating the structure using images from 10 newborns and then strength parameter is used to attune the filters. The observed rank-1 accuracy in this case is 36.32% which is at least 0.5% better than pre-trained ResNet ar-  chitecture (which is traditionally fine-tuned with newborn training data). Also, when we use training images of only 10 newborns to train filter of CNN models from scratch, the test accuracies are extremely low.
As discussed before, we can learn "structure" from large domain-specific data and then the proposed "strength" can help attune the filters for problem-specific data. Therefore, we perform experiments with pre-trained networks (pretrained filters are obtained after learning from either Ima-geNet or Labeled Faces in the Wild dataset (LFW) [19] and YouTube Faces (YTF) [44] databases) and use strength parameter to attune it for newborn face recognition based on training data of 10 newborns. For this experiment, as shown in Table 2, we use variants of ResNet [17], VGG [38], VGGFace [36], LightCNN [46], and DenseNet [18] architectures, and the performance is compared with standard fine-tuning approaches using same images from 10 newborns. As shown in Table 2, we have observed that learning strength of the filters improves the performance of CNN models compared to conventional fine-tuning approach. With single gallery image per subject, the best rank-1 accuracy of over 70% is obtained when the proposed strength parameter is used with pre-trained VGG-Face [36] which is at least 10% better than the conventional finetuning based approach. This shows that in real-world applications, the concept of learning structure and strength helps in achieving improved performance.
The performance of the proposed approach is also compared with deep hybrid network [35] and ScatNet [1]. For one gallery per subject, the rank-1 accuracies of these two algorithms are 25.18% ± 1.33% and 31.04% ± 1.94% respectively, which are at least 39% less than the best results reported in Table 2. Finally, we also compare the performance of the proposed algorithm with the Vinyals et al. [42], Hariharan et al. [15], and Bharadwaj et al. [3] on newborn face database. Using the same protocol, Figure 9 illustrates the comparison between the proposed method (best reported result in Table 2) with existing methods. The proposed method improves the rank-1 accuracies by Table 2. Rank-1 identification accuracies (%) on the newborn face database [3]. The results are reported for fine-tuned pre-trained models and with learning the strength of pre-trained filters. The last three models are trained on face databases and the remaining models are trained on ImageNet [6] database. 11 − 19% for varying number of sample(s) per subject. However, the proposed algorithm consistently yields improved accuracies and is approximately 4.5% better than the second best performing approach [15].
Omniglot Database: On the Omniglot database [24], SSF-CNN yields classification accuracies of 97.6% ± 0.84% and 98.3%±1.03% for 1-shot, 5-way and 5-shot, 5-way, respectively which are comparable to state of the art results. Table 3 summarizes the results of the proposed algorithm and compares them with existing algorithms. The results show that SSF-CNN is among the top performing algorithms for both the protocols.

Discussion and Conclusion
Large training database is a key requirement for training convolutional neural networks. However, there are several applications and problem statements that do not have the luxury of large training databases. In this research, we propose Structure and Strength Filtered CNN as a framework for learning a CNN model with small training databases. We propose to initialize the filters of CNN using dictionary filters which can be trained with small training samples. Since the dictionary atoms are learned for reconstruction, they may not be optimal for classification. Therefore, we next suggest to learn the strength of the filters with the given training data. The effectiveness of the proposed model has been demonstrated on multiple object classification databases and a real-world newborn face recognition problem. Using different architectures and experiments, we demonstrate the efficacy of the proposed approach. Specifically, in case of newborn face recognition, remarkable improvement in accuracy is achieved with the proposed approach. The proposed CNN has the flexibility to work for small as well as large databases. The current model incorporates unsupervised dictionary filters to initialize the CNN network. As a future work, other trained filters such as su- Table 3. Classification results (%) on the Omniglot database [24].

Algorithm
1-shot, 5-way 5-shot, 5-way Santoro et al. [37] 82.8 94.9 Koch et al. [21] 97.3 98.4 Vinyals et al. [42] 98.1 98.9 Proposed 97.6 98.3 pervised dictionary filters can also be used. They can also be used to adapt the filters from one task to another task while learning only the strength of the filters. The proposed algorithm can also be extended to other applications such as face recognition with variations in disguise [7], matching faces in videos [14], and sketch to photo matching [33].