# Classification of Breast Cancer in Mammograms with Deep Learning Adding a Fifth Class
## 3 Materials and Methods
### Data Augmentation and Transfer Learning  
When working with mammograms, the number of images is limited; toward performing a better CNN training without overfitting [13,24], it is necessary to increase the amount of ROIs to obtain better efficiency in classifiers. For this reason, we performed data augmentation by rotating the images in 90\({}^{\circ}\) intervals, turning from left to right, and applying the CLAHE technique to improve the contrast of the cropped ROIs. Experimentation shows that using the exponential function in CLAHE best fits the histogram model usable for a mammogram. We observed how values were equalized, tending toward dark values and partially maintaining certain gray levels, resulting in a decrease in image brightness and a more excellent contrast [36,39]. The different types of classification can be observed in Figure 2, showing the significant effect that the CLAHE method has on the regions by exponentially improving the image. By augmenting the data using \"normal\" ROIs, applying CLAHE, rotating the images 90\({}^{\circ}\), 180\({}^{\circ}\), 270\({}^{\circ}\), flipping left to right, and removing their backgrounds, we reached a total of 12,582 regions of interest from both databases. Table 2 shows the data augmentation. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Database** & **ROI** & **Original** & **Extra ROI** & **CLAHE** & **90\({}^{\circ}\)** & **180\({}^{\circ}\)** & **270\({}^{\circ}\)** & **Backgroundless** & **Augmented ROIs** \\ \hline \multirow{6}{*}{**MIAS**} & Benign Calibration & \multirow{2}{*}{3} & \multirow{2}{*}{70} & \multirow{2}{*}{73} & \multirow{2}{*}{146} & \multirow{2}{*}{146} & \multirow{2}{*}{146} & \multirow{2}{*}{584} & \multirow{2}{*}{1168} \\  & & & & & & & & & \\ \cline{1-1} \cline{5-10}  & & & &  
Since the formulation of CNN architecture can take too much time and resources in testing, we decided to engage in transfer learning. A previously trained image classification network that has already learned to extract robust features from images can be a starting point for training breast cancer classifiers. Accuracy, precision, speed, and network size are the most important characteristics; furthermore, networks should be chosen with a trade-off between these characteristics [42]. For the lesion classification, we used 4 CNN topologies that were pre-trained with 1 million images to classify 1000 different classes of the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) [43]. The first CNN we used was AlexNet [25] with a depth of eight layers, three fully connected and five convolutional layers, obtaining 61 million parameters. The second CNN we used was GoogLeNet [26]; it contains 22 layers with 7 million parameters and is based on the inception architecture to better use the computational resources on the network and go deeper, achieving this through the network-in-network (NIN) approach of [44]. Due to the network architecture, it is possible to work on computers with low computational resources and even training only on CPUs. The third network we used was ResNet50, created by [PERSON] et al., 2015 [27] with a depth of 50 layers that give way to 25.6 million parameters and set the tone at ILSVRC 2015 by successfully controlling the gradient vanishing problem. The last CNN applied was Vgg19, it uses 144 millions of parameters with 19 layers depth having a size of 535 Mb, being the heaviest networks in this work [34]. Implementing AlexNet, GoogLeNet, Resnet50, and Vgg19 topologies, we carried out fourteen studies with different training parameters, applying transfer learning. Each of these three widely used classification topologies has advantages in efficiency, convergence, and processing time. The networks mentioned above were created to classify 1000 objects, the fully connected layer (AlexNet: 23, GoogLeNet: 142, Resnet50: 175, and vgg19: 45) was modified to classify 4 or 5 classes.