# A Review of Explainable Deep Learning Cancer Detection Models in Medical Imaging
## 3 Explanation Methods for Deep Learning Cancer Detection Models
### Post-Hoc
We perform a weighted combination of forward activation maps, and follow it by a ReLU to obtain,  
\[L_{Grad-CAM}^{c}=ReLU(\sum_{k}a_{k}^{c}A^{k}) \tag{4}\]  
The authors of [29] propose a modified version of CAM called pyramid gradient-based class activation.they used PG-CAM a densely connected encoder decoder-based feature pyramid network (DC-FPN) as a backbone structure, and extracts a multi-scale Grad-CAM that captures hierarchical features of a tumor. Mathematically, PG-CAM is defined as follows. \[PGCAM_{c}=\sum_{p=1}^{5}ReLU(\sum_{k_{p}}\sum_{i}\sum_{j}\frac{\partial L^{c}} {\partial f_{ij}^{k_{p}}}f_{k_{p}}^{k_{p}}(X,Y))=\sum_{p=1}^{5}GradCAM_{c}^{ cp} \tag{5}\]  
where \(k_{p}\) is the unit of the feature map \(s_{p}\), \(GradCAM_{s_{p}}^{c}\) is a GradCAM generated from the feature maps delivered from each scale \(p\), and the PG-CAM aggregating the GradCAMs will consequently contain information on multiple scales of the feature pyramid. Integrated gradients has became popular due to its ability to explain models that use different data modalities. This is in addition its ease of use, theoretical foundation, and computational efficiency. Formally, Integrated Gradients is defined as follows  
\[IG(x)=(x_{i}-x_{i}^{\prime})\times\int_{\alpha=0}^{1}\frac{\partial F(x^{ \prime}+\alpha\times(x-x^{\prime}))}{\partial x_{i}}d\alpha \tag{6}\]  
where \(i\) is the feature, \(x\) is the input, \(x^{\prime}\) is the baseline, and \(\alpha\) interpolation constant to perturb features by. Note that this integral is often approximated due to computational costs and numerical limits. Occlusion is a simple to perform model agnostic approach which reveals the feature importance of a model. It can reveal if a model is overfitting and learning irrelevant features as in the case of adversarial examples. Adversarial examples are inputs designed to cause the model to make a false decision. In that case, the model misclassifies the image (say malignant as benign) despite the presence of discriminating feature occluding all features (pixels) one-by-one and running the forward pass each time can be computationally expensive and can take several hours per image. It is common to use patches of sizes such as 5 \(\times\) 5, 10 \(\times\) 10, or even larger depending on the size of the target features and computational resources available. CAM and Grad-CAM calculate the change in class score based on features extracted by the model. These two methods then visualize the features that cause the largest change in class score. On the other hand, occlusion occludes part of the image and then calculates the change in class score using the occluded image. It repeats this for many patches of the image and the patch that produces the largest change in class score is deemed the most important. Both methods produce a heatmap highlighting the most discriminative areas of the image. Therefore, the largest difference between the two techniques is how the they compute the most discriminative area of the image. The disadvantage of occlusion is that it is computationally expensive and takes longer to compute than CAM or Grad-CAM. The advantage of Grad-CAM and CAM is that they can compute their results in one pass instead of many passes like occlusion techniques. The disadvantage of Grad-CAM and CAM is that they only take into account the feature maps therefore could produce misleading results whereas occlusion takes into account different patches of the image. A summary of these methods is presented in Table 1.