## 3 Proposed Method
The residual connections within the network help prevent issues related to exploding and vanishing gradients. Therefore, this structure allows the creation of deeper models. The ResNet-50 model is widely employed for image classification tasks, and the pretrained ResNet-50 model is trained on a dataset of over one million images spanning 1000 different classes included in the ImageNet database. The size of the input images for the ResNet-50 architecture is 224 \(\times\) 224. **Gradient-Weighted Class Activation Mapping (Grad-CAM):** In recent decades, deep learning models have achieved significant success in handling image classification tasks. Although deep learning models can accomplish various tasks well, interpreting the results of the model is not always easy. Therefore, Grad-CAM, introduced by [37], addresses this issue by providing a visual explanation of CNN predictions. These properties of the model allow researchers to understand which areas of an image are most responsible for the decision. Mathematically, Grad-CAM computes a weighted sum of the feature maps, where the weights are the gradients of the score for the target class with respect to the feature maps [37]. This process produces a localization map, emphasizing the areas in the image that contribute to the final decision of the network. Grad-Cam uses the gradient information of the CNN. First, the gradients of the class score with respect to the feature map are computed as follows [37]:  
\[\frac{\partial y^{c}}{\partial A^{k}} \tag{2}\]  
Figure 2: The flowchart of the proposed method. where \(y^{c}\) is the score for class \(c\), \(A^{k}\) is the feature map, and \(k\) represents the indices of the feature map. After that, in order to determine the importance of the feature map \(k\), gradients are globally average pooled as follows [41]:  
\[\alpha_{k}^{c}=\frac{1}{Z}{\sum_{i}}{\sum_{j}}\frac{\partial y^{c}}{\partial A _{ij}^{k}} \tag{3}\]  
Here, \(Z\) represents the size of each feature map, and the subindices \(i\) and \(j\) denote the position of \(A^{k}\). The equation given above actually calculates the global average pooling of gradients via backprop. Finally, the heatmap is calculated as a weighted combination of the forward activation map. In order to obtain the final heatmap results, the weighted combination of maps is given as an input to the ReLU function. Let \(L_{Grad-CAM}^{c}\) denote the heatmap; then it is calculated as follows [41], as shown in (4):  
\[L_{Grad-CAM}^{c}=ReLU\Bigg{(}\sum_{k}{\alpha_{k}^{c}A^{k}}\Bigg{)} \tag{4}\]  
One of the major advantages of Grad-CAM is its applicability to a wide range of CNN-based architectures without altering the network's structure. This flexibility makes Grad-CAM a valuable tool for explaining black-box models. In addition to enhancing interpretability, Grad-CAM has also been used in hybrid deep learning models to extract meaningful features from localized image regions, as accomplished in this study. **Feature Selection Module--ElasticNet**: ElasticNet was used for feature selection in this study. This method incorporates the advantages of Lasso (L1 regularization) and Ridge (L2 regularization), making it particularly suitable for high-dimensional data. ElasticNet was proposed in [42] and focuses on the limitations of Lasso by linearly combining L1 and L2 penalties. This approach is especially beneficial for feature selection tasks. ElasticNet accomplishes this task not only by shrinking coefficients to prevent overfitting but also by performing variable selection by reducing some coefficients to zero. In this way, non-essential features are eliminated from the model.