## 2 Materials and Methods
### Methods
As a result of the segmentation process, the percentages of Q, A, and P in the thin-section image are found. The sum of the determined percentages should be 100%. If the sum is not 100%, the percentages should be renormalized. The normalized percentages are placed at the appropriate points on the QAP diagram. These points correspond to a specific region on the diagram and this region indicates the rock type. If a thin-section rock sample contains 25% quartz, 35% alkali feldspar, 20% plagioclase and others, the total is 80. Since the sum is not equal to 100, it is normalized and calculated as quartz 32%, alkali fieldspar 43% and plagioclase 25%. According to these values, the rock type is determined according to the intersection of the three values in the QAP diagram. Figure 6 shows an illustration of this example. In order to demonstrate the effectiveness of the proposed semantic segmentation network, multiple state-of-the-art (SOTA) models are put to the test. These models will be trained on the dataset and their results on the validation set will be compared with the values discussed in the metrics section to select the final model. DeepLabV3+, as an advanced version of the DeepLab semantic segmentation framework, represents a significant advance in the field of computer vision in the task of segmenting complex images into their components. DeepLabV3+ integrates the strengths of spatial pyramid pooling and encoder-decoder structures. A major advantage introduced with DeepLabV3+ is the inclusion of an atrous convolution strategy, which allows the model to control the field of view and capture multi-scale information without a significant computational cost increase. This feature is critical for understanding objects at various scales, a common challenge in semantic segmentation tasks. Furthermore, the use of the model's improved atrous spatial pyramid pooling (ASPP) module allows it to better capture context and detail by combining features at multiple scales. ConvNeXt is another widely used Convolutional Neural Network (CNN) model for image segmentation [21; 33]. It is a SOTA architecture built on CNNs and inspired by Transformer-based models, particularly exemplified in the Image Vision Transformer (ViT) architecture. This hybrid approach exploits some of the limitations of traditional CNNs, in particular their inefficiency in handling long-range dependencies and their ability to adapt to various types of data. ConvNeXt modifies the standard convolution layer design to improve parameter efficiency and computational effectiveness. Using a pyramidal structure, the model combines features from different resolution levels, resulting in more detailed and accurate results compared to traditional neural networks. ConvNeXt consists of multiple convolutional blocks, each designed to process features at different scales, enabling it to take into account a wider context and better understand complex image content. SegFormer employs a hierarchical Transformer encoder to process input images, setting itself apart from conventional methods by efficiently encoding multi-scale features without relying on large-scale convolutions or intricate pre-training routines [30]. Its primary innovation lies in featuring a lightweight pyramidal decoder, which adeptly gathers and encodes the multi-scale features produced by the Transformer encoder. This architectural choice enhances the model's capability to handle diverse image resolutions and contexts, while simultaneously boosting the extraction speed and reducing computational requirements. In practical applications, SegFormer has demonstrated superiority over existing segmentation models in handling intricate and nuanced semantic details across various  
Figure 3:1 Mineral identification and rock naming using QAP diagram. datasets. It stands out as a model offering high accuracy, even in challenging scenarios where object boundaries are ambiguous, showcasing a remarkable ability to effectively fuse features across different dimensions.