# Deep Learning Architectures for Diagnosis of Diabetic Retinopathy
## 2 Materials and Methods
### DRIVE Dataset
#### 2.1.1 Data Augmentation  
We perform different data augmentation transformations to the training set images due to the lack of variability of the dataset (only 20 images available for training) and thus increase the generalization capability of the models and prevent over-fitting. We can find this to be a common technique in the literature when dealing with DRIVE and similar datasets. However, unlike other authors, we have not employed cropping and scaling techniques in small image portions [28], so the detail of specific regions of the eye is not explicitly provided to the networks (the zoom applied is very small and, even with the maximum, we always capture the entire eye). Although the values of the transformations applied have been slightly modified depending on the model (specified at Table 2), a generic description of the employed techniques is given below:  
* Random rotation: Always applied, with lower and upper bounds for the rotation angle \(\alpha\) given by parameter \(\theta\), i.e., \(\alpha\in[-\theta,\theta]\) rad.
* Random horizontal flip: With probability \(p_{hf}\).
* Brightness adjustment: Being applied 10% of the time with a random factor \(\beta\) between an upper and lower bound \([\beta_{min},\beta_{max}]\), where \(\beta=0\) gives a complete black image,  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Training (Labeled) Images** & **Testing (Unlabeled) Images** & **Resolution** \\ \hline DRIVE & 20 & 20 & \(584\times 565\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Table summary of the DRIVE dataset main features.  
Figure 1: Example of one of the train set images (**left**) and its corresponding label (**right**). The blood vessels are segmented in white and the retinal background in black.  
\(\beta=1\) leaves the original image unchanged and \(\beta>1\) increases the brightness by that factor.
* Contrast adjustment: Furthermore, being applied with a probability of 10%, based on a factor \(\kappa\) between an upper and lower bound \([x_{min},x_{max}]\), where \(\kappa=0\) gives a solid gray image, \(\kappa=1\) leaves the original image unchanged and \(\kappa>1\) increases the contrast by that factor.
* Gamma correction: Known as Power Law Transform, applied again with a probability of 10% with a fixed \(gain\) factor of 1 and a random \(\gamma\) factor, again between some upper and lower bounds around 1. Values smaller than 1 make the dark regions lighter while values larger than 1 make the shadows darker.
* Random affine: Transformation of the image with probability \(p_{\alpha}\), keeping the center invariant. It combines a translation in both \(x\) and \(y\) directions, i.e., \([tx,y_{min},tx,y_{max}]\) and \(t\in\), plus a random zoom of the image up to a maximum and, also, an \(x\)-shearing parameterized between two values \([s_{min},s_{max}]\).
* Random gaussian noise: With a fixed zero-mean (\(\mu=0\)) and a variable standard deviation \(\sigma\).  
Figure 2 shows an example of the different transformations applied to one of the images so that the effect can be seen.