## 3 Data and Methodology
### Methodology
#### 3.2.1 Localizing Potential Lesions  
Consider the \(C\)-classes classification task based on DNNs, including the DCNNs and Transformers. Given the input image \(\mathbf{x}\), the DNNs denoted as \(F(\mathbf{x};\mathbf{W})\) would output the prediction result \(\mathbf{a}^{L}\) after the layer-by-layer forward computation, where \(L\) denotes the number of layers in the DNNs. \(\mathbf{a}^{L}\) is a vector in the length of \(C\), whose elements indicate the probability of each class. Generally, the largest component in \(\mathbf{a}^{L}\), suppose \(\mathbf{a}^{L}_{c}\), would be the category assigned to the input \(\mathbf{x}\). What we are interested in is which part in the \(\mathbf{x}\) contributes to the class \(c\).  
There are multiple ways to solve the above problem. Here, the CAM [13] is utilized for its computational efficiency and simplicity. An essential component in the CAM is the global average pooling (GAP), which is first proposed in the NIN [45] architecture to reduce the use of fully connected (FC) layers. The GAP average the feature maps along the dimension of the channel to reduce the features from a three-dimensional tensor to a one-dimensional vector. In the modern architecture of DNNs, it is common to use the GAP in the penultimate layer to get the global representation of the input, followed by an FC layer whose dimension is \(C\). The core idea of CAM can be regarded as the reverse computation of the above steps, where the learnable weight in the last FC layer (which can be considered as the importance of feature per channel) is used to weight the extracted features to indicate which part in the input is associated with the prediction.  
Formally, suppose the features fed into the GAP are denoted as \(\mathbf{a}^{L-1}\) in the shape of \([K,W,H]\) that indicate the number of channels, width, and height, respectively. \(\mathbf{W}^{L-1}\) represents the learnable weight within the last FC layer in the shape of \([C,K]\). The probability of class \(c\) is then given by the softmax equation \(\mathbf{a}^{L}_{c}=\frac{exp(\mathbf{x}^{L}_{c})}{\sum_{l=1}exp(\mathbf{x}^{L}_{c})}\). The scalar variable \(\mathbf{z}^{L}_{c}\) is computed as:  
\[\mathbf{z}^{L}_{c}=\sum_{k=1}^{K}\mathbf{W}^{L-1}_{c,k}\cdot\sum_{w=1}^{W}\sum_{h=1}^{ H}\mathbf{a}^{L-1}_{k,w,h}. \tag{1}\]  
The summation on the right side of the above equation represents the GAP, which can be regarded as the feature's context representation along the dimension of the channel. The parameter \(\mathbf{W}^{L-1}\) thus indirectly represents the contribution of each channel in the \(\mathbf{a}^{L-1}\) to the predicted score. By leveraging the information contained in \(\mathbf{W}^{L-1}\) to integrate \(\mathbf{a}^{L-1}\) in a channel-wise way, it is then possible to highlight the probable areas corresponding to the predicted class. This computation process can be formulated as:  
\[\mathbf{M}_{c}=\sum_{k=1}^{K}\mathbf{W}^{L-1}_{c,k}\cdot\mathbf{a}^{L-1}_{k}, \tag{2}\]  
where \(\mathbf{M}_{c}\) denotes the CAM for class \(c\). Each channel in \(\mathbf{a}^{L-1}\) represents a visual pattern discovered by DNNs. Therefore the CAM can be considered as a weighted summation of the presence of each visual pattern at different spatial locations. Note that the CAM represents the visual pattern in the feature-level's spatial resolution, which is much smaller than the input image. The CAM is required to be upsampled to the resolution of the input image in order to identify the image regions corresponding to the predicted category.