# Applying Deep Learning Methods for Mammography Analysis and Breast Cancer Detection
## 3 Materials and Methods
### Computer Vision Models  
We experimented with several deep learning models based on CNN and ViT architectures, such as ResNet [37] or EfficientNet [38], and MaxViT [39]. ResNet is a type of CNN that was introduced by researchers at Microsoft in 2015. ResNet is designed to address the problem of vanishing gradients in deep neural networks by introducing residual connections. The idea behind residual connections is to add a shortcut connection between the input and output of a block of layers, allowing the network to learn residual functions that map the input directly to the output. This helps to mitigate the vanishing gradient problem, which can occur when training very deep neural networks. In ResNet, residual connections are introduced every few layers, allowing the network to learn increasingly complex functions without suffering from degradation in performance. \begin{table}
\begin{tabular}{c c} \hline \hline
**Data:** RSNA dataset of mammograms \\
**Result:** Classification of mammograms; For positive examples provide a visual cue about decision. \\ \(image\_resolution\leftarrow[256\times 256,512\times 512]\) \\
**foreach image\_resolution** **do** \\   Process DICOM images to PNG format and create \(original\_dataset\) \\   Apply cropping, windowing and normalization and create \(processed\_dataset\) \\   Select \(positive\_examples\) from \(processed\_dataset\) \\   Train StyleGAN-XL with \(positive\_examples\) and generate \(synthetic\_images\) \\ \(augmented\_dataset\gets processed\_dataset+synthetic\_images\) \\
**end** \\
**foreach**\(original\_dataset\), \(processed\_dataset\), \(augmented\_dataset\)**do** \\   Upsample positive examples & /* 5 times */ \\   Data augmentation & /* Horizontal flip */ \\   Apply Stratified 5-fold Cross Validation \\   Train resnet18, resnet34, resnet152, efficientnet\_b0, and maxvit\_nano\_rw\_256 \\   models & /* timm pre-trained models */ \\   Apply inference \\
**if**\(positive\_instance\)** \\   calculate class activation maps \\   calculate bounding boxes \\
**end** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: StyleGAN-XL training parameters. The ResNet architecture consists of multiple blocks of convolutional layers with batch normalization and activation functions, followed by a global average pooling layer and a fully connected output layer. The number and type of layers can be varied depending on the specific application, but the basic building block is the residual block with two or more convolutional layers. Figure 1: Generation of synthetic images. The results obtained after a certain number of iterations. first row—after 40 k images; second row—after 120 k images third row—after 1000 k images; fourth row—after 2000 k images; fifth row—after 2500 k images; sixth row—after 3000 k images. EfficientNet is also a family of CNN architectures that was introduced in 2019 by researchers at Google. The main goal of EfficientNet is to achieve high accuracy on image classification tasks while minimizing the computational cost and number of parameters needed. It achieves this by using a compound scaling method that scales the width, depth, and resolution of the network in a systematic manner. This approach ensures that the network is both efficient and effective, as it balances the trade-off between accuracy and computational cost. Specifically, the EfficientNet architecture combines three techniques: (a) Efficient scaling up or down the width, depth, and resolution of the network in a systematic way; (b) Use of a new mobile inverted bottleneck convolution (MBConv) block, which reduces computation and increases accuracy; (c) Use of a compound coefficient that controls the network scaling uniformly, making it easier to scale up or down the network for different resource constraints. The result is a family of CNN architectures that is highly efficient and has achieved state-of-the-art results on several image classification tasks, including the ImageNet dataset.