# Understanding How Image Quality Affects Transformer Neural Networks
## 3 Experimental Setup
### Distortion Types  
In the context of image processing, additive Gaussian distortion involves adding random values sampled from a Gaussian distribution to each pixel in an image. This process can simulate various real-world scenarios where noise is present, such as electronic sensor noise in cameras or transmission noise in communication channels. Mathematically, \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Architecture** & **Year** & **Number of Parameters** & **Memory Footprint in Bytes** \\ \hline ViT-B/16 [47] & 2020 & 86,567,656 & 346,270,624 \\ ViT-L/16 [47] & 2020 & 304,326,632 & 1,217,306,528 \\ LeViT-128 [48] & 2021 & 9,213,936 & 38,448,128 \\ LeViT-256 [48] & 2021 & 18,893,876 & 77,266,064 \\ LeViT-384 [48] & 2021 & 39,128,836 & 158,338,896 \\ Swin-S [49] & 2021 & 49,606,258 & 198,886,024 \\ Swin-B [49] & 2021 & 87,768,224 & 351,533,888 \\ Swin-L [49] & 2021 & 196,532,476 & 786,590,896 \\ MobileViT-XXS [50] & 2021 & 1,272,024 & 5,104,800 \\ MobileViT-XS [50] & 2021 & 2,317,848 & 9,305,440 \\ MobileViT-S [50] & 2021 & 5,578,632 & 22,363,808 \\ CVT-13 [56] & 2021 & 19,997,480 & 80,093,144 \\ CVT-21 [56] & 2021 & 31,622,696 & 126,658,712 \\ CVT-W24 [56] & 2021 & 277,196,392 & 1,109,323,744 \\ EfficientFormer-L1 [57] & 2022 & 12,289,928 & 49,306,864 \\ EfficientFormer-L3 [57] & 2022 & 31,406,000 & 125,934,952 \\ EfficientFormer-L7 [57] & 2022 & 82,229,328 & 329,429,000 \\ SwiftFormer-XS [58] & 2023 & 3,475,360 & 13,925,488 \\ SwiftFormer-S [58] & 2023 & 6,092,128 & 24,404,344 \\ SwiftFormer-L1 [58] & 2023 & 12,057,920 & 48,281,280 \\ SwiftFormer-L3 [58] & 2023 & 28,494,736 & 114,061,408 \\ VAN-B6 [59] & 2023 & 26,579,496 & 106,421,776 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Considered transformer architectures. if \(I(x,y)\) represents the intensity of a pixel at coordinates \((x,y)\) in the original image, and \(N(x,y)\) represents the Gaussian noise at those coordinates, the distorted image \(I^{\prime}(x,y)\) can be expressed as [60]:  
\[I^{\prime}(x,y)=I(x,y)+N(x,y). \tag{1}\]  
Here, \(N(x,y)\) is a random variable with values sampled from a Gaussian distribution. In our experiments, we adjusted the variance in \(N(x,y)\) from 0 to 0.3 in increments of 0.01. Multiplicative Gaussian distortion in image processing involves introducing multiplicative noise to an image, where the noise values are sampled from a Gaussian distribution [61]. Unlike additive Gaussian distortion, which adds noise directly to the pixel values, multiplicative distortion multiplies the pixel values by a factor determined by Gaussian noise. Mathematically, if \(I(x,y)\) represents the intensity of a pixel at coordinates \((x,y)\) in the original image, and \(N(x,y)\) represents the Gaussian noise at those coordinates, the distorted image \(I^{\prime}(x,y)\) can be expressed as:  
\[I^{\prime}(x,y)=I(x,y)\cdot(1+N(x,y)). \tag{2}\]  
Here, \(N(x,y)\) is a random variable with values sampled from a Gaussian distribution. The term \((1+N(x,y))\) represents the multiplicative factor applied to the original pixel value. In our experiments, we adjusted the variance in \(N(x,y)\) from 0 to 0.3 in increments of 0.01. A Gaussian blur is a common technique used to reduce image noise and detail. The mathematical definition involves applying a Gaussian function to the image, which effectively smooths it. The Gaussian function in two dimensions is given by:  
\[G(x,y)=\frac{1}{2\pi\sigma^{2}}e^{-\frac{x^{2}+y^{2}}{2\sigma^{2}}}, \tag{3}\]  
where \(\sigma\) is the standard deviation, which determines the extent of the blur. Further, \(x\) and \(y\) are the distances from the origin in the horizontal and vertical axes, respectively. A larger \(\sigma\) results in a greater blur, as the Gaussian function spreads out more. Conversely, a smaller \(\sigma\) results in less blur, with the function more concentrated around the center. To apply this blur to an image, the Gaussian function is used as a convolution kernel.