# Medinoid: Computer-Aided Diagnosis and Localization of Glaucoma Using Deep Learning +
## 2 Methodology
### Grad-CAM  
In practice, most medical images do not have any localization information, making it impossible to apply a state-of-the-art image segmentation approach like U-Net [30]. Therefore, we  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Model** & **Input Size** & **Optimizer** & **Data Augmentation** & **\# of Layers or Blocks** \\ \hline VGG-16-B & \(224\times 224\times 3\) & SGD & crop, horizontal flip & 16 layers \\ VGG-16-M & \(224\times 224\times 3\) & ADAM & crop, horizontal flip, contrast & 16 layers \\ ResNet-152-B & \(224\times 224\times 3\) & SGD & crop, horizontal flip & 152 layers \\ ResNet-152-M & \(299\times 299\times 3\) & ADAM & crop, horizontal flip, contrast & 152 layers \\ Inception-v4-B & \(299\times 299\times 3\) & RMSProp & crop, horizontal flip, brightness adjustment, contrast & 14 inception blocks \\  & & & adjustment, saturation & \\ Inception-v4-M & \(299\times 299\times 3\) & RMSProp & crop, horizontal flip, contrast & 14 inception blocks \\  & & & adjustment & \\ \hline \hline \end{tabular}
\end{table}
Table 3: Overview of the different model configurations for VGG-16 [38], ResNet-152 [39], and Inception-v4 [31]. When the name of a model contains the label “B”, this means that the model adopted the settings from the paper that introduced the model in question. When the label “M” has been added to the name of a model, this means that our research context has been taken into account, resulting in the modification of settings, the addition of regularizers such as data augmentation and dropout, and/or a change of the optimizers used. RMSProp, Root Mean Squared Propagation.  
adopted Gradient-weighted Class Activation Mapping (Grad-CAM) [45] to localize glaucoma, a weakly-supervised learning approach, forgoing the need to give explicit segmentation information to a network. Grad-CAM generalizes the Class Activation Mapping (CAM) method originally proposed in [46], integrating gradient weights. CAM visualizes what CNNs look at when they classify the input, highlighting activations in the feature maps of the last convolutional layer, using the predicted output and backpropagation.  
To produce the final localization map \(L^{g}_{Grad-CAM}\) of the glaucomatous area, we first calculate the gradients of the predicted output \(y^{g}\) for the class glaucoma with respect to the feature maps \(A^{k}\) of the last convolutional layer, having width \(u\) and height \(v\), where \(k\in\{1,2,\ldots,K\}\), and with \(K\) denoting the total number of feature maps. The result \(\dfrac{\partial y^{g}}{\partial A^{k}}\) then goes through a global-average pooling process, calculating the weights \(\alpha^{g}_{k}\) of the glaucoma class as follows:  
\[\alpha^{g}_{k}=\dfrac{1}{u\times v}\sum_{i}\sum_{j}\dfrac{\partial y^{g}}{ \partial A^{k}}. \tag{1}\]  
Equation (1) can be interpreted as the importance of each feature map for the glaucomatous class. The weights and the corresponding feature maps are linearly combined and subsequently given as an input to a Rectified Linear Unit (ReLU) [47], with the latter only selecting the positive activations. The overall process can be formally summarized as follows:  
\[L^{g}_{Grad-CAM}=\text{ReLU}(\sum_{k}\alpha^{g}_{k}A^{k}). \tag{2}\]