## 3 Materials and Methods
### Developed Fine-Tuned Enhanced Pyramid Network (FT-EPN)  
Our first strategy to improve the base model was to focus on reducing overfitting. To achieve this, we integrated dropout layers and implemented the following steps: To address overfitting, L2 weight regularization was applied, and among the tested regularization coefficients, a coefficient of 0.0001 was found to be the most effective. Dropout rate values of 0.3 and 0.4 were also evaluated, but it was observed that the L2 regularization approach performed better. L2 regularization adds a penalty term, equal to the square of the model coefficients, to the loss function of the model. This penalty is calculated based on the size of the weights and prevents the model's weights from reaching very large values. L2 regularization squares each element of the weight matrices in the model and adds the sum of these values to the loss function. L2 regularization updates the loss function of the model, as shown in Equation (1):  
\[L_{new}=L_{original}+\lambda{\sum}w^{2} \tag{1}\]  
Here, _new_ represents the updated loss value after regularization, _original_ represents the original loss value, \(\lambda\) represents the regularization coefficient (0.0001), and \(w\) represents each weight in the model. This penalty prevents the weights from reaching very large values, creating a model with smaller weights. Limiting the weights prevents the model from overfitting to the training data and helps it become more generalizable. When using the Adam optimization algorithm, the most appropriate value for the learning rate was evaluated as 0.0001. The epoch step was set to 10 and the patience value was set to 3. Early stopping was applied when no progress was observed, and training was stopped if there was no improvement. A convolutional layer was added before each MaxPooling layer in the robust model created with the optimal learning rate, L2 regularization, and early stopping, resulting in an increase in accuracy. Figure 5: The schematic representation of the multi-axis vision transformer (MaxViT) architecture. A pyramid-type architecture was applied to help the model learn complex features more effectively, and the number of neurons in the layers was gradually adjusted. In this strategy, the model learned simple features by using fewer neurons in the first layers, and the number of neurons was increased in the deeper layers to extract more complex and high-level features. The number of neurons was reduced again towards the last layers, supporting the model's specialization for the output. This pyramid structure fine-tuned the model's complexity and increased the accuracy rate by allowing for the model to learn features at different levels in each layer. Figure 6 illustrates the model's pyramidal CNN architecture. In this pyramid-type structure, the number of filters increases gradually as the number of layers increases and decreases in the last layer. In this architecture, simple features (edges, corners, etc.) are extracted in the first layers, while more complex structures are learned as the model progresses deeper. The last layer Conv2D (256 filters, 3 \(\times\) 3 kernel size) plays an important role in the model and serves two main purposes:  
* Feature Enhancement: It provides a deeper and more detailed analysis of the features extracted in the previous layers of the model. In this layer, the complex patterns learned from the input data are processed at a higher level. As a result, the feature map becomes more meaningful and contains features that are more suitable for the model's classification or detection tasks. * Reducing Channel Depth: Using 512 filters in the previous layer extracts a large number of features, which increases the computational cost. Reducing the number of filters in the last layer to 256 lightens the computational load of the model. Thus, a more compact representation is obtained before moving to the classification layer. This process helps the model work more efficiently while preserving the essential information needed.