## 3 Proposed Methodology
### Resnet Network and Attention Mechanism  
The proposed research is divided into three stages: CNN- CRF tumor segmentation, Resnet-50 tumor feature mapping, and XG-Boost ensemble learning. CDR from MRI images was classified using ResNet-50. ResNet-50 is a 50-layer residual deep learning network that was created to solve the vanishing gradient problem in CNN during backpropagation. The \"vanishing gradient\" problem occurs when the second-order derivatives (the gradient) matrix approaches zero in nonlinear optimization. The second issue with deepening networks is that adding layers blindly increases training error.  
Deep networks can be trained using residual models. Categorical cross-entropy was the most effective way to gauge loss, as shown in Equation (2). The ResNet-50 model employs a large number of convolutions. Several filters are used to identify images (e.g., a three-pixel size filter). These filters are applied to the original image and layered on top of it. An attention layer is applied for improving the features by learning and improving the feature weights. As the focus function tests weight distribution, it estimates an array. X\({}_{i}\), f(X\({}_{i}\), X\({}_{i+1}\)) features are from the second layer and f(X\({}_{i}\), X\({}_{i+1}\), \(\cdot\cdot\cdot\), X\({}_{i}\) + L\(-\)1) are from the L-th layer. These feature values indicate the responses of multi-scale n-grams, i.e., unigram X\({}_{i}\), bigram X\({}_{i}\) X\({}_{i+1}\), and L-patches X\({}_{i}\) X\({}_{i+1}\)\(\cdot\cdot\cdot\) X\({}_{i}\) + L\(-\)1. In the focus mechanism, the filtered ensemble and reweight scale are used in unison. A scale-descriptor filter is generated to feature at each scale X\({}_{i}\) at position \(i\). In addition, scale reweight is used to compute the SoftMax distribution of attention weights using the descriptors as data, and it outputs weighted attribute weights for reweighing [13].  
Figure 1 description is already given in Segmentation Section 3.3, but here we explained block wise significance of Figure 1. First of all by Figure 1 shows the segmentation  
with convolution network using four convolution layers with 0.2 dropout and combined the features in SoftMax activation and after CNN find the segmentation edge. In this edge some edges are sharp, so for smoothing this process uses conditional random field which show in smoothing edge block. By this block refine the edges by efficient threshold which dynamically define by CRF block. Other blocks show input, middle edges, and output. In CNN input 3 by 32, there is first Conv layer 32 by 32, second Conv layer 32 by 32, third Conv layer 32 by 64 by 15, fourth Conv + pool layer 64 by 15, then flattened layer 64 by 64. Figure 2 shows the classification process segmented images, as seen in Figure 1. Then, we apply CNN variant Resnet-50, which divided it into 5 blocks: first block 7 by 7 by 64, second block 1 by 1 by 64, third block 1 by 1 by 128, fourth block 1 by 1 by 1024, and fifth block 1 by 1 by 2048. Following these features, we used the XG-Boost block to make a prediction model and then tested it on various analytical performance parameters.  
Figure 3 illustrates three classes of brain tumor detection in addition to four phases and figures. The second image segmentation is on the right side, the third image has an attention mechanism on the left side, the fourth image has residual activation on the right side, and the first image prediction is on the left side, is Prediction.