## 3 Methodology
### The Proposed Approach (SwT+Resnet50V2)  
The Swin Transformer is a robust computer vision tool that serves as a modified version of the vision transformer. Figure 2 displays a block diagram of the Swin converter [42]. The drawing displays four distinct architectural components. The patch partition layer divides the input image into patches. Subsequently, the linear embedding layer and the oscillating transformer block are both subjected to modification. Each of the four stages in the basic structure consists of a linear embedding layer that is repeated multiple times, along with an oscillating transformer block. The Swin Transformer is constructed using a modified self-attention model and a block that includes layer normalization (LN), a multilayer perceptron (MLP), and multi-vertex self-attention (MSA). To address the challenges of classification and accurate identification of tumors and normal tissues, we employed the Swin Transformer in this study. Self-attention, the basic structure of the transformer, multiplies the input features by the WQ, WK, and WV matrices, the parameters of which are subject to learning. This indicates that the three token matrices produced by multiplication are Q, K, and V. V represents the information obtained, K denotes the response, and Q signifies the inquiry. The contribution of all other pixels to a specific pixel is determined by multiplying the q token of that pixel by the k tokens of all other pixels. The overall contribution value of the pixel is determined by multiplying the normalized light by the corresponding pixel values and summing the resulting values. This is the equation:  
\[\mathbf{Attention}(\mathbf{Q},\mathbf{K},\mathbf{V})=\mathbf{Softmax}\left(\frac{\mathbf{Q}\mathbf{K}^{T }}{\sqrt{d_{k}}}\right)\mathbf{v} \tag{1}\]  
After multiplying each pixel in the image by every other pixel, the total is lighted. A rise in channels and picture size results in a more complex algorithm. The temporal complexity is O(N2) for N pixels. Consequently, most transformers reduce self-attention to a limited window to minimize processing demands. However, this results in an unexpected decrease in the global feature collection ability for self-attention; even if the method is confined to a brief duration, the computational cost remains at a high level. \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Rescale & 1.0/255 \\ \hline Horizontal flip & True \\ \hline Vertical flip & True \\ \hline Brightness range & 0.8–1.2 \\ \hline Labeling & 2 labels \\  & 4 labels \\ \hline \end{tabular}
\end{table} 
Table 2: Parameters used during the preprocessing phase for each CNN model. Figure 3 shows the block design of the ResNet50 architecture. It ranked first in the ILSVRC 2015 classification competition based on ImageNet. In ref. [43], the architecture was explained. Nowadays, they are utilized for many different tasks related to machine vision. The remaining networks and ResNet50 have 50 layers. The syntax can be modified to use an input size of (256 \(\times\) 256) instead of (224 \(\times\) 224). ResNets use direct access connections to extend beyond a number of network layers. This omission results in accelerated learning during network compression. There is a correlation between the feature inference and the residual network. ResNets address the problem of decreasing accuracy. The transfer learning model used in this study is ResNet50. Adaptable learning transfer and image identification are performed directly using the trained model. The dataset used in this study is used to train the model. The combination of the Swin Transformer and ResNet50V2 is an enhanced model to contribute to enhancing feature extraction and improving classification accuracy. The Swin Transformer model skillfully captures local and global features of images, allowing the model to create a broad and rich representation of the extracted features.