{'fraction_non_alphanumeric': 0.029859422893985837, 'fraction_numerical': 0.018496987633442555, 'mean_word_length': 4.884017412935323, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sparsifying and Down-scaling Networks to Increase Robustness to Distortions

It has been shown that perfectly trained networks exhibit drastic reduction in performance when presented with distorted images. Streaming Network (STNet) is a novel architecture capable of robust classification of the distorted images while been trained on undistorted images. The distortion robustness is enabled by means of sparse input and isolated parallel streams with decoupled weights. Recent results prove STNet is robust to 20 types of noise and distortions. STNet exhibits state-of-the-art performance for classification of low light images, while being of much smaller size when other networks. In this paper, we construct STNets by using scaled versions (number of filters in each layer is reduced by factor of n) of popular networks like VGG16, ResNet50 and MobileNetV2 as parallel streams. These new STNets are tested on several datasets. Our results indicate that more efficient (less FLOPS), new STNets exhibit higher or equal accuracy in comparison with original networks. Considering a diversity of datasets and networks used for tests, we conclude that a new type of STNets is an efficient tool for robust classification of distorted images.


I. INTRODUCTION
After introduction of AlexNet [13], which attracted close attention to the convnets, a vast variety of conv net architectures has been proposed (ResNet [8], GoogLeNet [16], VGG16/19 [17] etc). Until recently, network performance was improved by means of new model with bigger number of parameters and more sophisticated techniques like skip connections, batch normalization, etc.
Most recent trend in constructing neural networks is to optimize network in term of number of parameters. For example, EfficientNet [19] is optimized in three dimensions, i.e., width (number of filters in convolution layers), depth (number of layers) and input image resolution. Two key takesaway here are 1) it is possible to make more efficient networks with higher accuracy than existing state-of-the-art models; 2) network specs (width and depth) should be considered together with input specs (image resolution).
On the other hand, conv nets with more than one processing stream have started to gain popularity. To our knowledge, the first two-stream network was introduced by Chorpa [2] and it is widely known as a "Siamese network". The motivation behind two streams is that each of the streams carries information about a dedicated image. Images fed to the streams are different. Two-stream networks have been used for the vast variety of tasks (similarity assessment [Siamese networks and pseudo-Siamese [2], [25]], segmentation-based change detection [24], action recognition in videos [18], one-shot image recognition [12], simultaneous detection and segmentation [7], humanobject interaction recognition [6], group activity recognition [1], etc. These networks merge different types of information, e.g., image and video, to achieve high accuracy for new tasks.
Another recent trend is testing network performance with adversarial distortions, which are used to check network stability. It was found that even slight distortions can ruin performance of very well tuned networks [3], [10], [15]. Therefore effective method to reduce influence of distortions is necessary.
The most recently, a new family of multi-stream network called Streaming Networks (STNets) [20] has been proposed. It has been shown that cloning the networks into multiple streams and using non-identical intensity slices of the input image as inputs into separate streams increases noise robustness.
In this paper, inspired by optimization behind EffientNet, we propose a practical method to make STNets smaller (number of parameters), faster (FLOPs) and increase noise robustness at the same time.

II. PRIOR WORKS
It was confirmed that even well trained state-of-the-art models can easily misclassify distorted images [15]. Furthermore, several studies have illustrated that performance of conv nets is fragile on various types of distortions, e.g., impulse noise [10], Gaussian noise and blur [3], various noise types and elastic transforms [5]. There are also numerous studies reporting failure of conv nets due to various types of adversarial attacks [4], [14].
We refer to brief description of some specific types of noise provided in [9](p. 3) : "Shot noise ... is electronic noise  caused by the discrete nature of light. Impulse noise is a color analogue of salt-and-pepper noise. Defocus blur occurs when an image is out of focus. Zoom blur occurs when a camera moves toward an object rapidly. Snow is a visually obstructive form of precipitation. Frost forms when lenses or windows are coated with ice crystals. Fog shrouds objects. Brightness varies with daylight intensity. Contrast can be high or low depending on lighting conditions. Elastic transformations stretch or contract small image regions. Pixelation occurs when upsampling a low-resolution image. JPEG is a lossy image compression format that increases image pixelation and introduces artifacts".
Study [9] also shares observation that under all equal conditions, simpler models often generalize better and deliver higher robustness to noise.
STNets [20] has been designed to address the issue of robustness to noise and various types of other distortions. STNet is a neural network, which consist of multiple parallel streams. Each stream has a unique input in a form of an intensity slice of the original input image. Intensity slices are obtained from the original image by keeping pixel values within a certain range and zeroing out others outside the range.
Outputs of all streams are concatenated and fed into a single joint classifier. Each stream takes a unique intensity slice of an input image. An example of intensity slices is presented in Fig.  1 (original image comes from Carvana 1 dataset). Architecture of the STNet is presented in Fig. 2.
STNet [20] has confirmed high robustness to noise, when tested on a random zero noise [21]. A random zero noise implies that values of random pixels are set to 0 for all color channels. STNet's noise robustness has been also confirmed using all 19 types of distortions provided by Cifar10 Corrupted dataset [22]. Finally, STNet robustness to noise was illustrated for adverse weather and lighting conditions. It has been demonstrated that STNet outperforms most of the start-of-theart models or in the cases of VGG16 delivers very similar accuracy, while been much smaller (∼30x) in terms of number of params [23].

DOWN-SCALED VERSIONS OF THE STATE-OF-THE-ART MODELS
The inspiration for the novel architecture comes from three sources: 1) EfficientNet's successful example of conv net optimization; 2) observation that smaller models are more robust (see section II); 3) STNet's robustness to various types of noise and distortions.
The idea to use down-scaled version of VGG16 model as a stream in STNet has been first proposed in [22]. It has been illustrated that STNet, which used down-scaled VGG16-based streams, has outperformed original VGG16 network in the case of low light image classification. Schema of down-scaled VGG16-based STNet is presented in Fig. 3.
In this study, we generalized approach by using down-scaled version of VGG16 [17], ResNet [8] and MobileNetV2 [11]. We refer to these models as to base models. We call an approach of constructing STNet architectures based on downscaled version of some networks to be a sparsif ication of such networks.
While MobileNetV2 can be naturally down-scaled using αmultiplier, we have designed specialized scalable versions for VGG16 and ResNet50 models.
In general, we do not require that number of filters in each conv layer of the original network equals total number of filters in corresponding conv layers in STNet architecture.
Next, throughout the paper we name STNet architecture using the following template: STNet{num of streams} {scale} {base network name}, where num of streams is a number of streams in STNet, scale is a scale factor, which number of filters in each conv layer of an original model is divided by, scale factor can be any real number, base network name is a name of the base network. For example, STNet name STNet(5) 5 ResNet50 describes 5stream STNet based on 5x down-scaled ResNet50. In the case of MobileNetV2, scale equals 1/α. For all the STNet architectures in this paper, we use classifier of the following structure: 1) the outputs of the streams are flatten and concatenated together; 2) result of concatenation is fed into fully connected layer of 400 units with ReLU activation; 3) then batch normalization layer followed by ReLU activation layer are applied; 4) output of ReLU activation layer is fed into the softmax classifier.

A. Model choices
We have selected VGG16, ResNet50 and MobileNetV2 for experiments. VGG16 and ResNet50 are convolutional nets based on classic convolution layers, while MobileNetV2 uses the most recent advanced technique of depthwise separable convolution. The down-scaled versions of these state-of-theart networks are used as parallel streams.

B. Objective
The objective is to find STNet architectures based on VGG16, ResNet50 and MobileNetV2, which outperform or deliver similar accuracy level, while being faster in terms of FLOPs.

C. Datasets and Protocol
Cifar10 and Cifar10 Corrupted are used in experiments. Cifar10 is used as training set. We test both base networks and corresponding derived STNets for each type of distortion in Cifar10 Corrupted dataset. For each experiment, we randomly select 50,000 of Cifar10 images. Cifar10 Corrupted also contains 50,000 for each type of distortions.
We perform two types of test with and without data augmentation. Tests without data augmentation imply that both base model and derived STNet model are trained using Ci-far10 original images and tested using corresponding Cifar10 Corrupted samples. Tests with data augmentation imply that 50% of randomly selected distorted images are added to original training set. The networks are then tested using 50% of remaining distorted images. We do not use any type of image preprocessing.
The model search is done using tests without data augmentation. The data augmentation tests are performed using selected STNet models.
Throughout the experiments we only use 5-stream STNets. To find the STNet model, which outperforms the base model in terms of accuracy of distorted images classification, we test STNet architectures with the same base model with different scaling factor. We start our tests with STNets, which in total have the same number of filters in each convolutional layer with based networks' convolution layer. For example, STNet5 5 ResNet50 has 5 streams and only 20% filters of ResNet50 are contained in each stream. The number of filters in the first convolutional layer of ResNet50 equals the total number of filters in the first convolutional layers in all 5 streams. In general, we first test STNet5 5 VGG16, STNet5 5 ResNet50 and STNet5 5 MobileNetV2.
If the first model does not outperform base model, we reduce scale factor and continue tests. We put original constrain that STNet models should be faster in terms of FLOPs than corresponding base models. If we find STNet model which outperforms the base model, we stop tests with such base model.

D. Results
We have obtained three STNet models which outperform or deliver similar performance to the base model. Our first test of STNet5 5 ResNet50 has confirmed that this model satisfies requirements of the protocol.
For remaining two models, we have tested various scaling factor value before we could find an appropriate model. In the case of VGG16 network, we have tested STNets with scaling factor of value 5, 4, 3, 2 and 1.5. On the later one was successful resulting in STNet5 1.5 VGG16 architecture. In the case of MobileNetV2, we have tested STNets with scaling factor of value 5 (α = 0.2), 3 (α = 0.33) and 2.5 (α = 0.4). On the later one was successful resulting in STNet5 2.5 MobileNetV2 architecture.
The base model and corresponding STNet architectures are summarized in TableI. The comparison of the number of parameters and FLOPs is presented in Table II. In Table II, values presented in brackets are ratios between specs of STNet architecture and the ones of corresponding base networks.
One can infer that all the models are much faster in terms of FLOPs. STNet5 1.5 VGG16 and STNet5 5 ResNet50 are also smaller in terms of number of parameters than their correspoding base networks: 0.979x and 0.237x for VGG16 and ResNet50, respectively. On the other hand, STNet5 2.5 MobileNetV2 is nearly twice bigger in terms of parameters for MobileNetV2.
Noise type-wise accuracies for each model are presented in Tables III and IV for no data augmentation tests and data augmentation tests, respectively.
Tests without data augmentation. It can be concluded from the Table III that in most of the case all STNet models deliver similar performance or outperform the base networks. Especially high improvement is observed in the case of Tests with data augmentation. According to the Table IV, in the case of data augmentation, VGG16-and ResNet50based STNet architectures essentially outperform base models for all types of distortions. In the case of MobileNetV2, STNet architecture deliver at least 5% accuracy decreased compared with MobileNetV2 in the case of impulse noise and shot noise.
After applying data augmentation, performance of both base models and corresponding derived STNet architectures has essentially improved. To measure the effect of augmentation depending on the type of a model, we compute a difference in performance after and before augmentation for each model for each distortion type. We call this difference an augmentation boost. Using the augmentation boost, we can investigate how augmentation effected the performance of the model.
In order to compare augmentation boost for each pair of base model and corresponding STNet architecture, we illustrate data for both models in one chart. Figs. 4, 5 and 6 compare VGG16 model vs. STNet5 1.5 VGG16, ResNet50 vs. STNet5 5 ResNet50 and MobileNetV2 vs. STNet5 2.5 MobileNetV2, respectively. From 4 and 5, one can infer that in both cases STNet architecture outperforms in accuracy the corresponding base model for all types of noise. However, in the case of MobileNetV2 vs. STNet5 2.5 MobileNetV2 pair, base model outperforms corresponding STNet architecture in augmentation boost for elastic transform, fog, frost, gaussian noise and blur, glass blur, impulse noise, shot noise and speckle noise. This illustrates limitations of the STNet, when MobileNetV2 is used as a base model.
Finally, we found that STNet5 1.5 VGG16 is the best model with pronounced supremacy in accuracy over all other networks. STNet5 1.5 VGG16 also exhibits the highest data augmentation boost among all the models across all the noise types.

V. DISCUSSION AND CONCLUSION
Our results indicate that the network with the highest accuracy is STNet5 1.5 VGG16 delivering start-of-the-art results. This network is essentially smaller and faster than original VGG16. For example, STNet5 1.5 VGG16 computations take only 8.9% of VGG16 computations in FLOPs. The possible reason is the original VGG16 has two fully connected layers of size 4094 each. This constitutes the major amount of computations.
We have also shown that STNet architectures can deliver higher or similar accuracy for distorted image classification for under no data augmentation conditions for all three selected base models, i.e., VGG16, ResNet50 and MobileNetV2. On the other hand, for data augmentation test STNets based on VGG16 and ResNet50 models exhibit essential augmentation boost and outperform base models in accuracy for all types of noise. However, for MobileNetV2 in the case of impulse and shot noise, it was not possible to achieve accuracy improvement over the base model.
In all the cases, STNet architecture took much less computations in terms of FLOPs. STNets based on VGG16 and ResNet50 are also smaller in terms of number of params. Boost in accuracy after data augmentation: ResNet50 vs. STNet5 5 ResNet50 However, in the case of MobileNetV2, selected model was nearly twice bigger.
The worst performance was exhibited by MobileNetV2 for all types of distortions. This suggests that networks based on classic convolution layers like VGG16 and ResNet50 are more robust to noise than MobileNetV2. In general, STNet architectures can essentially increase robustness to noise for all types of noise in the case of VGG16 and ResNet50 as base models. The applications of MobileNetV2-based STNets is limited.
We speculate here that after training on any dataset, a network becomes fine-tuned to a given dataset. There is always a question how well the trained network generalizes beyond the samples seen during the training. Especially, when network trained on one dataset and then tested on a different dataset, it is important to understand how much a trained network is "overfitted" to the first dataset. Overall, STNet models demonstrate a high level of generalization to unseen samples in the case of distorted images.
In the paper [21], it was illustrated that input-induced sparsity (image intensity slices used as input into different streams) and hard-wired sparsity (parallel weight-decoupled streams) are both necessary for noise robustness to emerge in multi-stream architectures based on a simple conv net. STNet model based on the state-of-the-art models are build upon both input-induced sparsity and hard-wired sparsity. Thus, we have proved that the same principles are correct in the case of state-of-the-art models. Therefore, our experimental results illustrate the STNet is a flexible architecture capable of increasing noise robustness and applicable for a variety of networks. The effective models for can be found using simple search by varying scaling factor value.
Finally, our approach as well as EfficientNet optimization deals with both network specs (width in terms of parallel streams and number of filters) and input specs (intensity slices). In contrast to EfficientNets optimization, we focus on FLOPs and noise robustness, which is essentially an accuracy on dataset derived from a different statistical distribution than a training set, rather than accuracy on a test set derived from the same statistical distribution as training set. Therefore, we are looking for models with higher generalization ability for previously unseen samples.
Summarizing, we conclude that STNet is a flexible (applicable for a variety of model) and efficient (in terms of FLOPs and number of params) architecture, which enables to increase robustness to various distortions. Therefore STNet is a promising tool to make original neural network models more robust to noise and other types of distortions.