# Bilinear CNN Model for Fine-Grained Classification Based on Subcategory-Similarity Measurement
## 4 Results
### Datasets and Implementation Details  
We evaluate the proposed method on two classical fine-grained datasets: CUB-200-2011 and Stanford Cars-196. The detailed statistics with category numbers and data splits are summarized in Table 1. Cars-196 contains 196 types of vehicles, each subcategory contains 48\(\sim\)136 images, and the dataset is classified according to the manufacture, model, and age of the car. Each class contains 24\(\sim\)68 training images, and the remaining images are used as the testing set. CUB-200-2011 consists of 11,788 images of 200 bird species with preselected training and testing splits. We used the publicly available VGG-16 as the basic model in all comparisons to be consistent with previous work using the open-source library MatConvNet. The input images were resized to 448 \(\times\) 448 and only horizontal flip was used to double the training data for comparing with other methods under the same standard; the predicted results of the original image and its flipped copy were averaged during the test to obtain the final results. The configuration of the computer was: GTX1080 ti, Core (TM) i7 processor, and Ubuntu 16.04 Caffe deep-learning framework.  
In our method, CNN has two different effects: localization and classification. They are both based on the widely used VGG-16, and the architectures of VGG-16 are modified to accommodate different functions: Before using B-CNN to extract features, a weakly supervised localization method is adopted to eliminate the influence of complex background noise and extract more accurate features. During the weakly supervised localization period, the convolution descriptors of the image are extracted by CNN to locate the target. In order to obtain higher spatial resolution, input images are resized to \(448\times 448\) and layers after \(pool_{5}\) are removed. The CNN framework is pretrained on the ILSVRC 2012 dataset [32] and then fine-tuned on the fine-grained image-classification datasets to obtain the bounding box of the main object. For example, by employing the pretrained VGG-16 model, we can get a \(28\times 28\times 512\) activation tensor in \(pool_{5}\), and obtain the final mask map of \(relu_{5-2}\) according to the descriptors of \(relu_{5-2}\) and \(pool_{5}\).  
Since our key contribution is in the subcategory similarity, we chose VGG-16 as the two streams in B-CNN for classification, which removes the last three fully connected layers. Considering the trade-off between its representation capacity and computational efficiency, we adopted a symmetric bilinear form to ease training. We used the code provided by the author [19], which fuses two convolutional neural networks to obtain the orderless descriptors of the input image and add the weakly supervised localization as well as the subcategory-similarity measurement. The conv5 layer of VGG-Net is used to initialize the network and fine-tune the network with a small learning rate. Firstly, the size of the input images is adjusted to \(448\times 448\), and features are extracted through two networks. By sum-pooling and \(\ell_{2}\) normalization, the bilinear features of size \(512\times 512\) are obtained. The softmax classifier is used for image classification to generate the fuzzying similarity matrix. Then, the fuzzying similarity-driven deep metric learning via triplet loss and weighted softmax loss is used to increase interclass differences as well as reduce intraclass differences, thus enhance the distinguish ability of the model to these significant similar subcategories. When training images on Cars-196, the weights of the two networks in Equation (10), are initialized by sampling from two Gaussian distributions with mean value 0 and standard deviation 0.01 and 0.001, respectively. The offset was set to 0, while the minibatch size of the SGD was set to 20. Weight decay was set to 0.0002 with a momentum of 0.9 and an initial learning rate of 0.001. The learning rate was reduced to 1/10 every 5000 iterations and training terminated at 40,000 iterations.