\documentclass[conference]{IEEEtran}

\usepackage{graphicx}   % Required for including images
\usepackage{amsmath}    % Required for equations
\usepackage{algorithm}  % For algorithms
\usepackage{algorithmic}% For algorithmic environment
\usepackage{caption}    % For customizing captions
\usepackage{float}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\geometry{margin=1in}
\usepackage[colorlinks=true, linkcolor=black, citecolor=black, urlcolor=black]{hyperref}


\documentclass{article}

\begin{document}

\title{Vision transformer vs. ResNet-101: an explainable deep learning approach for breast cancer detection in ultrasound images}

\author{

\IEEEauthorblockN{Manogna Kanukurthi\textsuperscript{1}}

\IEEEauthorblockA{manogna\_kanukurthi@srmap.edu.in}
\\[-0.5em]
\and

\IEEEauthorblockN{Mahitha Vedampudi\textsuperscript{2}}
\IEEEauthorblockA{nagasuvarnamahitha\_vedampudi@srmap.edu.in}
\\[-0.5em]
\and
\IEEEauthorblockN{Sathwika Nibbaragandla\textsuperscript{3}}
\IEEEauthorblockA{sathwika\_nibbaragandla@srmap.edu.in}
\and
\IEEEauthorblockN{Jahnavi Kamana\textsuperscript{4}}
\IEEEauthorblockA{jahnavi\_kamana@srmap.edu.in}
\and
\IEEEauthorblockN{Lipismita Panigrahi\textsuperscript{5}}
\IEEEauthorblockA{lipismita.p@srmap.edu.in}
\\[-0.7em] 
\and
\IEEEauthorblockN{} 
\IEEEauthorblockA{}
\and
\IEEEauthorblockN{}
\vspace{-1cm}
\IEEEauthorblockA{\textsuperscript{1-5}Department of Computer Science and Engineering, SRM UNIVERSITY, Amaravati, Andhra Pradesh, India}
}
\maketitle


\begin{abstract}
Breast cancer persists as a major worldwide health issue, and increasing patient survival rates requires an early and precise diagnosis.  In order to divide breast ultrasound images into benign, malignant, and normal categories, this research compares two deep learning architectures: the Vision Transformer (ViT) and the Convolutional Neural Network (CNN) based ResNet-101. Addressing the common challenge of limited data, we employed a data augmentation strategy to expand a benchmark dataset of 780 images to over 10,000 images, creating a robust training set. Both models were trained on this augmented dataset, achieving test accuracies of 98.64\% for the Transformer model and 97.57\% for Resnet-101 model. The result indicates that the ViT model performed better with accuracy than the ResNet-101. Furthermore, the existing Deep learning models are black box models. To increase model openness and foster clinician confidence, Gradient-weighted Class Activation Mapping (Grad-CAM), an Explainable AI (XAI) technique, is utilized to generate visual heatmaps, emphasizing the specific regions in the ultrasound images that were most influential in the models’ diagnostic decisions. The proposed model harnesses GPU-based parallel infrastructure. The results indicate that the ViT model outperforms the other existing models. 
\end{abstract}

\begin{IEEEkeywords}
Breast Cancer, Deep Learning, ResNet-101, Vision Transformer, Explainable AI, Grad-CAM
\end{IEEEkeywords}

\section{Introduction}

\subsection{Motivation}
For women residing in rural areas, accessing a breast
examination is often hindered by personal privacy concerns
and the significant travel distance to a clinic. The associated
costs and logistical challenges render the pursuit of a second
or third opinion nearly impossible, precluding the possibility
of a comprehensive diagnostic evaluation. Local medical
practitioners frequently possess limited experience and lack
access to a network of specialists required to interpret
ambiguous cases with certainty. Consequently, a Computer
Aided Diagnosis (CAD) system offers a valuable solution,
serving as an assistant that provides an objective and reliable
analysis of ultrasound imagery. Ultimately, this technology
delivers expert support directly to these communities, en-
suring that every woman receives the timely and accurate
medical care essential for a favorable prognosis \cite{OpenAI_ChatGPT_GPT5.1_2025}.


\subsection{Overview of Existing Methods}
Lately, deep learning has shown excep-
tional performance in medical image analysis \cite{he2016deep}. Similarly, Desai \cite{desai2021anatomization} highlighted that Convolutional
Neural Networks (CNN) have been extensively applied for breast cancer classification using ultrasound images. Architectures like VGG, Inception, and
Residual Networks (ResNet) \cite{yadav2024resnet}, often achieve high accuracy
by leveraging transfer learning. More recently, the  Vision Transformer (ViT) \cite{li2025vision}, an architecture that adapts the success of transformers from natural language processing to
computer vision, has emerged as a powerful alternative. ViT based models have shown competitive, and sometimes superior performance to CNNs by capturing global contextual
information within an image. While
many studies focus on a single architecture, a direct, comprehensive comparison between CNN model and Transformer model remains an
area ripe for exploration. However from the existing state-of-the-art CNN model like ResNet-101 \cite{bajcsievaluating, wang2024cnn, tagnamas2024multi} and Transformer model like ViT \cite{singh2024enhanced} gain popularity. Therefore, this study proposed a comparative evaluation between the two models. 



\subsection{Contribution and Paper Outline}
The main contribution of this study is given below:

\begin{enumerate}
    \item A comparative study is conducted using two advanced architectures: A fine-tuned ResNet-101 and a ViT for breast ultrasound image classification on an augmented dataset.

    \item Optimize the performance of the model.

   \item The existing models are black box models therefore, to visualize and highlight regions influencing predictions, ensuring interpretability and confirming focus on diagnostically relevant areas, a Grad-CAM (XAI method) applied to both ResNet-101 and ViT model. 
    
    \item To improve the computational efficiency, a GPU based parallel infrastructure is used .\newline
    
    
\end{enumerate}

The following sections of this paper are structured as: Section \ref{Materials and Methods} shows the materials and methods, detailing the dataset, preprocessing strategies, model architectures, and the Explainable AI techniques employed. Section \ref{Result and Discussion} explains the experimental evaluation and results, including quantitative and qualitative performance. Finally, Section \ref{Conclusion} provides the Conclusion, summarizing the key findings, highlighting the clinical relevance of the results, and suggesting potential directions for future research.
\section{Materials and Methods}
\label{Materials and Methods}
The proposed framework illustrated in Fig. \ref{Flowchart of proposed model} represents a systematic workflow encompassing data collection and augmentation, followed by model development, performance assessment, and interpretability analysis.
\vspace{-0.1cm}

\subsection{Demography and Preprocessing of Data}
The study made use of the benchmark Breast Ultrasound Image dataset \cite{qasrawi2025advancing}, which initially had 780 images split into three classes: normal (133 photos), malignant (210 images), and benign (437 images).  Additionally, to improve image clarity, these images were subjected to Speckle Reducing Anisotropic Diffusion (SRAD) \cite {panigrahi2024m} filtering for speckle noise reduction across different scales.  One of the main challenges of model training is this class disparity.  A data augmentation approach is used to address this and produce a reliable dataset.  A number of randomized geometric \cite{paschali2019manifold} and color transformations \cite{song2023quantum}, such as horizontal flipping \cite{ohmatsu2019visual}, rotation (up to 15 degrees) \cite{lin2001rotation}, translation \cite{lin2001rotation}, scaling, and color jitter, are applied to each of the 780 original photos to create about 12 new, distinct images. Following augmentation, the dataset comprised more than 10,000 images, which we distributed among the three separate groups: 70\% to train, 15\% to validate, and the remaining 15\% to test. To prepare the images for the models, we standardized their size to 224x224 pixels and applied ImageNet-based normalization.

\subsection{Deep Learning Architectures}
To achieve reliable and interpretable classification of breast ultrasound images, two complementary architectures were employed, a deep convolutional neural network (ResNet-101) and a transformer model (ViT). The objective of training both models was to categorize the input images into clinically relevant categories. Grad-CAM was applied on both ResNet-101 and ViT model to visualize the regions contributing most to its predictions.

\subsubsection{ResNet-101}

The ResNet-101 is a 101-layer Deep CNN that introduced residual learning via skip connections. This allows the network to learn identity mappings, mathematically expressed in (\ref{eq1}).
\begin{equation}
\label{eq1}
H(x) = F(x) + x
\end{equation}
where, $x$ is the input. This mechanism effectively alleviates the vanishing gradient problem \cite{hochreiter1998vanishing} in deep networks, enabling the model to learn multiscale textural and edge features essential for differentiating lesions in breast ultrasound imaging. Compared to shallower models, ResNet-101 offers superior feature discrimination and robustness against noise, making the pre-trained model an optimal backbone for detailed medical image categorization \cite{yan2025using}.




\subsubsection{Vision Transformer (ViT)}

The ViT captures extended range global dependencies in contrast to CNNs, which primarily extract features based on nearby regions. The ViT model divides an image into fixed size patches and treats them as tokens (analogous to words), which are then processed by self-attention and feed-forward networks \cite{irie2020much}. The self-attention mechanism, which computes interactions among all patches, is defined in (\ref{eq2}).
\begin{equation}
\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V
\label{eq2}
\end{equation}

In equation (\ref{eq2}), the Query ($Q$), Key ($K$), and Value ($V$) matrices are utilized, while $d_k$ represents the dimensional size of the key vector space.

This operation allows the ViT to effectively model spatial relationships between distant regions, enabling it to identify irregular shapes, diffused boundaries, or heterogeneous textures distributed across an image. For this reason, ViT complements ResNet-101 by capturing the holistic spatial structure of ultrasound images \cite{zhu2024radiomics}.

\begin{figure}
\centering
\includegraphics[width=1\linewidth]{Figure/fc3.jpg}
\caption{\textit{Flowchart of proposed model}} 
\label{Flowchart of proposed model}  
\end{figure}

\subsection{Explainable AI (XAI) Using Grad-CAM}
To ensure clinical acceptance despite high accuracy, Explainable AI (XAI) using  Gradient-weighted
Class Activation Mapping (Grad-CAM)
\cite{latha2024revolutionizing} was applied specifically for the ViT model for visualizing its decision rationale. Grad-CAM produces a class discriminative localization map $\left(L_{\text{Grad-CAM}}^c\right)$ by calculating the gradient of the target class score $\left(y^c\right)$ with respect to the final feature maps $\left(A^k\right)$, defined by the importance weight ($\alpha_k^c$) in (\ref{eq3}) and the final map.

\begin{equation}
    \alpha_k^c &= \frac{1}{Z} \sum_i \sum_j \frac{\partial y^c}{\partial A_{ij}^k}, 
    L_{\text{Grad-CAM}}^c &= \mathrm{ReLU}\left(\sum_k \alpha_k^c A^k\right)
\label{eq3}
\end{equation}

Here, $\alpha_k^c$ shows the importance weight of each feature map \cite{wang2021filter} for class $c$, and $Z$ is a normalization constant. The resulting heatmap $L_{\text{Grad-CAM}}^c$ is then superimposed onto the ultrasound image, which visually highlights the parts that had the greatest influence on the model's prediction.. This process validates the ViT model's focus on anatomically meaningful regions (like lesions), thus bridging the gap between performance and interpretability and enhancing diagnostic confidence.

\subsection{Proposed Model}
The workflow in Fig.\ref{Flowchart of proposed model}  represents the overall methodological pipeline adopted for breast ultrasound image classification using deep learning models. Initially, the benchmark dataset is collected and preprocessed by SRAD filter to de-noise the dataset. Further, to avoid the overfitting issue, data augmentations are used like rotation, flipping, and scaling to improve model generalization, along with normalization to normalize pixel intensity values. Then, the augmented dataset is separated into training, validation and testing subsets for a reliable evaluation of model performance. Further, a comparative study is done in-between ResNet-101 and ViT model. These models are trained independently on the preprocessed augmented data. Both models are jointly trained to optimize parameters and minimize loss. ResNet-101 leverages deep residual connections to capture spatial features, while ViT employs a transformer-based architecture to extract long-range dependencies across image patches. The validation set is employed to adjust hyperparameters and track the optimization process, whereas the test set evaluates final model performance on unseen data.

The proposed model for Malignant Tumor Detection in Ultrasound Images and its implementation in the above aspect is formulated in algorithm \ref{algorithm 1}. The model performance is calculated using accuracy, precision, F1-score, and a confusion matrix taken from \cite{pourmadadi2024breast}.

Model performance is quantified using performance metrics - accuracy, precision, recall, and F1-score which measures the model’s classification capability, sensitivity, and overall reliability. Finally, Grad-CAM is used in both models to produce visual explanations, highlighting the most influential regions in the ultrasound images that guided the model’s predictions. This interpretability step reinforces model transparency, aiding in clinical trust and understanding of the decision-making process.The proposed model harnessing with GPU based parallel infrastructure. 

\begin{algorithm}
\caption{Proposed Algorithm }
\label{algorithm 1}
\textbf{Input}
    \item \hspace{+1.5cm} $I = \{i_1, i_2, \ldots, i_n\}$ // Set of BUS images
    \item \hspace{+1.5cm} $G = \{g_1, g_2, \ldots, g_n\}$ // Ground truth labels
    \item \hspace{+1.5cm} $C \in \{\textit{Benign}, \textit{Malignant}, \textit{Normal}\}$  
    \item \hspace{+1.5cm} // Classification of classes\\
\textbf{Output}
\item \hspace{+1.5cm}Performance metrics
\item \hspace{+1.5cm}Confusion matrix\\

\textbf{Algorithm}
\begin{enumerate}
    \item {Initialize:}
    \[
    \begin{aligned}
        &M_r \leftarrow \text{ResNet101}, \quad M_v \leftarrow \text{ViT} \\
        &\theta_r, \theta_v \rightarrow \text{model parameters} \\
        &\alpha \rightarrow \text{learning rate}, \quad E \rightarrow \text{epochs}
    \end{aligned}
    \]

    
    \item{Preprocessing and Augmentation:} 
\[
\hspace{-2.0cm} P_I = \text{Preprocessing}(I)
\]


    \item{Train ResNet101 model:}
    \[
    \begin{aligned}
        &\hat{y}_r = M_r(x; \theta_r), \quad L_r = \mathcal{L}(\hat{y}_r, y), \\
        &\theta_r \leftarrow \theta_r - \alpha \nabla_{\theta_r} L_r
    \end{aligned}
    \]
    Repeat for all $E$ epochs $\Rightarrow M_r^*$.

    \item {Train ViT model:}
    \[
    \begin{aligned}
        &z_0 = [x_p^1E; x_p^2E; \ldots; x_p^{N_p}E] + E_{pos}, \\
        &\hat{y}_v = M_v(z_0; \theta_v), \quad L_v = \mathcal{L}(\hat{y}_v, y), \\
        &\theta_v \leftarrow \theta_v - \alpha \nabla_{\theta_v} L_v
    \end{aligned}
    \]
    Repeat for all $E$ epochs $\Rightarrow M_v^*$.

    \item {Evaluation:}
    \[
    \begin{aligned}
        [\text{Accuracy, Precision, } F_1 \text{-Score, Support}] &= \\
        &\text{\hspace{-1.1cm}Evaluate}(M_r^, M_v^, D_{test})
    \end{aligned}
    \]
    return confusion\_matrix

    \item{Apply GradCam(XAI Method)}
    \[
    \begin{aligned}
        &w_l = \frac{1}{Z} \sum_{i,j} \frac{\partial y^c}{\partial A_{ij}^l}, \quad
        G = \text{ReLU}\left(\sum_l w_l A_l\right)
    \end{aligned}
    \]
    Returns Grad-CAM overlays for visualization.
\end{enumerate}
\end{algorithm}



\section{Result and Discussion}

\label{Result and Discussion}
The experimental evaluation compared the performance of two deep learning models ResNet-101 and ViT on a substantially augmented breast ultrasound dataset with ground-truth masks for precise prediction verification. Grad-CAM visualizations were generated for both models to enhance interpretability by highlighting regions contributing most to their predictions. 
\begin{table}[b]
    \caption{\textit{ResNet-101 Performance metrics (\%)} }
    \label{tab1}
    \centering
    % Force the table to be 90% of the standard text width.
    % This is the most reliable way to prevent overflow.
    \resizebox{0.9\columnwidth}{!}{
        \begin{tabular}{|l|c|c|c|c|c|}
            \hline
            \textbf{} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-Score} & \textbf{Accuracy} & \textbf{Support} \\ \hline
            Benign & 100 & 94 & 97 & 97 & 500 \\ \hline
            Malignant & 97 & 98 & 98 & 96 & 500 \\ \hline
            Normal & 96 & 100 & 98 & 99 & 500 \\ \hline
            Macro avg & 98 & 97 & 97 & 97 & 1500 \\ \hline
            Weighted avg & 98 & 97 & 97 & 97 & 1500 \\ \hline
        \end{tabular}
    }
\end{table}

\begin{table}[b]
    \caption{\textit{ResNet-101 Performance metrics (\%)} }
    \label{tab2}
    \centering
    % Force the table to be 90% of the standard text width.
    % This is the most reliable way to prevent overflow.
    \resizebox{0.9\columnwidth}{!}{
        \begin{tabular}{|l|c|c|c|c|c|}
            \hline
            \textbf{} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-Score} & \textbf{Accuracy} & \textbf{Support} \\ \hline
            Benign & 99 & 96 & 97 & 98 & 500 \\ \hline
            Malignant & 98 & 99 & 98 & 97 & 500 \\ \hline
            Normal & 98 & 100 & 99 & 99 & 500 \\ \hline
            Macro avg & 98 & 98 & 98 & 98 & 1500 \\ \hline
            Weighted avg & 98 & 98 & 98 & 98 & 1500 \\ \hline
        \end{tabular}
    }
\end{table}
Experiments were conducted on a Microsoft Surface Pro 3 (Intel i7-4650U, 8 GB RAM, 238 GB SSD, Intel HD Graphics 5000) running Windows 10 Pro (64-bit), providing sufficient computational resources. The GPU H100 infrastructure is used to execute the proposed model having 8 Nodes 
Processor 1 x Intel® Xeon® Gold 6442Y Processor 60M Cache, 2.60 GHz,24 core
Memory 1TB (16 x 64GB) ECC DDR5 4800MHz RAM (Max 16 DIMMs) GPU 2 x H100 NVL
SSD 2 x 960GB Data Centre Grade 2.

All experiments were implemented in Python using PyTorch, Albumentations, and Torchvision for training and preprocessing. Model performance was evaluated with scikit-learn metrics and depicted using Matplotlib and Seaborn. The final system was deployed using Flask, incorporating Grad-CAM for explainable AI visualization of both models’ predictions.

The Table \ref{tab1} shows the ResNet-101 model achieved an overall accuracy of 97\%, slightly less than the ViT model. Its strong performance is confirmed by balanced macro and weighted-average F1-scores of 97\%.

Crucially, the model demonstrated high reliability in critical diagnosis by achieving 100\% recall for the normal class and 98\% for the malignant class. This extremely low false negative rate makes it highly suitable for fine-grained medical classification.

ViT accomplished an overall accuracy of 98\% with macro and weighted average f1-scores of 98\%, validating its strong predictive capability for this classification task as shown in Table \ref{tab2}. Its performance was characterized by precision 99\% for the class benign and perfect recall 100\% for the class normal. The malignant class was also strongly classified with f1-score 98\%. The only slight drop was in benign recall 96\%.
To provide detailed insight into classification performance, confusion matrices were generated for both models. This allows identification of specific misclassification patterns and per class performance analysis. Table \ref{tab3} represents the performance comparision of different models and the bold valued model, ViT, performs better. It also presents the computational time per epoch.

\begin{figure}[b]
    \centering
    \includegraphics[width=1.0\linewidth]
    {Figure/vit_confusion_matrix.jpg}
    \caption{\textit{ResNet-101 confusion matrix showing classification results for each class.}}
    \label{fig2}
\end{figure}
%\vspace{-0.5cm}

The Fig. \ref{fig2} depicts the confusion matrix for the ResNet-101 model demonstrates a high degree of classification accuracy among the three defined categories: benign, malignant, and normal.The 500 genuinely benign samples yielded the following distribution: 471 were assigned to the correct class, while 14 were erroneously labeled malignant and 15 were erroneously labeled normal. Crucially, for the malignant class, 492 out of 500 samples were correctly identified, indicating a high sensitivity for detecting malignancy, with only 2 samples incorrectly classified as benign and 6 as normal.

The normal category exhibited the strongest performance, with 499 of the 500 true normal cases correctly predicted, and only a single misclassification into the malignant category. Overall, the significant numbers on the diagonal demonstrate the model's reliable performance and strong capability to distinguish between classes. These results highlight the network’s capability to adapt effectively across diverse ultrasound image features, ensuring reliable detection and minimizing diagnostic errors.

\begin{figure}
    \centering
    \includegraphics[width=0.88\linewidth]
    {Figure/resnet_confusion_matrix.jpg}
    \caption{\textit{ViT confusion matrix showing classification results for each class.}}
    \label{fig3}
\end{figure}

 Fig. \ref{fig3} represents the confusion matrix of the ViT model with accurate classification across all categories.  The model shows robustness in differentiating between benign, malignant, and normal breast ultrasound images. 479 out of 500 were correctly predicted for benign cases, with 12 incorrectly classified as malignant and 9 as normal. The model shown strong performance by successfully identifying 494 out of 500 malignant cases. The remaining six errors were evenly divided: three incorrectly categorized as benign and three as normal. The normal class was nearly perfect, with 499 of 500 correctly classified and only one mislabeled as benign. These results highlight the ViT model’s superior capability in learning complex visual patterns and capturing subtle differences among tissue structures. The high values along the main diagonal of the confusion matrix further represent minimal overlap between classes, reflecting effective feature extraction and generalization. On a whole, the ViT model shown its reliability for automated breast ultrasound image analysis with excellent classification accuracy and consistency across all categories, much like ResNet-101. Moreover, the ViT model exhibits slightly better precision and overall accuracy compared to ResNet-101, validating its superiority in effectively capturing global contextual information from ultrasound images.

\begin{figure} [b]
    \centering
    \includegraphics[width=0.88\linewidth]{Figure/trainloss_resnet101.jpg}
    \caption{\textit{ResNet101: Training Loss per Epoch}}
    \label{fig4}
\end{figure}
\begin{figure}
    \centering
    \includegraphics[width=0.88\linewidth]{Figure/accuracy_resnet101.jpg}
    \caption{\textit{ResNet101: Train Vs Validation Accuracy}}
     \label{fig5}
\end{figure}
\begin{figure}
    \centering
    \includegraphics[width=0.88\linewidth]{Figure/trainloss_Vit.jpg}
    \caption{\textit{ViT: Training Loss per Epoch}}
     \label{fig6}
\end{figure}
\begin{figure}
    \centering
    \includegraphics[width=0.88\linewidth]{Figure/accuracy_ViT.jpg}
    \caption{\textit{ViT: Train Vs Validation Accuracy}}
     \label{fig8}
\end{figure}

\begin{figure*}
    \centering
    \includegraphics[width=0.7\linewidth]{Figure/output1.jpg}
    \caption{\textit{(a) original ultrasound images and (b) ground truth masks. (c) horizontally augmented images, (d) depicts 60° rotated images, (e) Grad-CAM visualization from ResNet101, and (f) Grad-CAM visualization from ViT.}}
    \label{fig7}
\end{figure*}
\begin{table}[h]
\centering
\caption{Performance Comparison of various models}
\begin{tabular}{|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{.7cm}|p{1cm}|}
\hline
\textbf{Model} & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-Score}&\textbf{Time (min)} \\ \hline
ResNet-101 &{98}  &{98}  &{98}  &{98} & 4.5\\ \hline
ViT &\textbf{97}  &\textbf{98}  &\textbf{97}  &\textbf{98} &9.2\\ \hline
SVM & 78 & 77 & 77 &77& 10.1 \\ \hline
ANN &  79& 80& 75  &77.49 &11.3 \\ \hline
AlexNet &86  & 89 & 89 &89& 9.8 \\ \hline
VGGNet &  88&90  &89  &89.49 &9.5 \\ \hline
\end{tabular}
\label{tab3}
\end{table}

Figures \ref{fig4}-\ref{fig8} shows the training and validation performance of the ResNet-101 and ViT models across epochs. For ResNet-101, the training loss rapidly decreases and stabilizes at a minimal value, while accuracy for both training and validation rises consistently above 98\%, indicating strong generalization. Similarly, the ViT model shown a constant decrease in loss and achieved about 97\% accuracy with uniform curves. Overall, both models demonstrated high accuracy, efficient convergence, and robust learning behavior, confirming their effectiveness for breast ultrasound image classification.



The Fig.\ref{fig7} represents the workflow for the benign and malignant breast lesions. Fig.\ref{fig7}(a) represents the original ultrasound images, (b) shows  ground truth masks, (c) horizontally augmented images and (d) depicts 60° rotated images.The Grad-CAM visualizations in Fig.\ref{fig7} (e and f) show a clear distinction: ResNet-101 produces diffuse activation maps, often extending past lesion boundaries, indicating suboptimal localization. On the other side, ViT-based Grad-CAM Fig. \ref{fig7} (f) generates sharply focused heatmaps that accurately align with the true lesion regions. This shows ViT's greater capacity to capture global contextual features, resulting in more accurate and interpretable lesion localization.


\section{Conclusion}
\label{Conclusion}
The built deep learning system creates a strong benchmark for three-class breast ultrasound classification by combining the complimentary feature extraction capabilities of the ViT (Transformer) and ResNet-101 (CNN) architectures.  Although both models obtained strong diagnostic accuracies, the comparison study showed that the ViT outperformed ResNet-101, which achieved 97\%, with a little better accuracy of 98\%.  This distinction highlights the ViT's improved ability to identify long-range dependencies and global contextual characteristics in ultrasound pictures, which improves its ability to distinguish between normal, malignant, and benign tissue patterns.  

By adding tumor detection and segmentation components to enhance localization, future work will expand this framework beyond classification.  The extension to three-dimensional (3D) analysis to establish full spatial awareness of the tumor will be a major focus. Additionally, we want to look into how quantum mechanical concepts may be applied to improve computational accuracy, which will ultimately allow the system to provide radiologists with a very trustworthy second opinion.


\bibliography{./IEEEabrv,./IEEEexample}
\bibliographystyle{IEEEtran}
%\bibliography{references}



\end{document}
\begin{figure}
    \centering
    \includegraphics[width=0.5\linewidth]{fc1.jpg}
    \caption{Enter Caption}
    \label{fig:placeholder}
\end{figure}