# RockDNet: Deep Learning Approach for Lithology Classification
## 4 Experimental Results
### CNN Models Training and Evaluation  
The remaining 20% is utilized for testing to evaluate the CNN models after training is conducted. Table 3 illustrates the network structure. On the other hand, Table 4 presents the details of the employed database. Table 5 illustrated precision, recall, and F1 score for each class of all employed CNN models in addition to the metrics of the proposed method. Upon the examination of Table 5, DarkNet-53 exhibited the highest classification accuracy of 99.22% amongst all CNN models, followed by DarkNet-19 and VGG19 with an accuracy of 98.4%. It can also be seen that the proposed CNN models maintained a classification accuracy above 96.9%. Despite the higher accuracy achieved by DarkNet53, the developed CNN model achieved a comparable accuracy of 96.9% with a huge saving in both parameters and model size of 69.6 K and 204 KB, respectively. This saving in terms of size on disk is around 98.32% compared to that of darknet-53 model with a loss in accuracy of merely 2.32%. This small loss is negligible compared to the benefit saving in both time and memory, where small model sizes offer advantages in terms of applicability \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class\(\backslash\)Precious** & **Number of Samples** & **Training (80\%)** & **Testing (20\%)** \\ \hline Carbonate & 239 & 191 & 48 \\ \hline Sandstone & 196 & 156 & 40 \\ \hline Shale & 211 & 169 & 42 \\ \hline Total & 646 & 516 & 130 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Dataset details. \begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **Layer Name** & **Output Shape** \\ \hline
1 & Input Image & \(128\times 128\times 3\) \\ \hline
2 & 2-D Convolution & \(128\times 128\times 10\) \\ \hline
3 & Batch Normalization & \(128\times 128\times 10\) \\ \hline
4 & 2-D Max Pooling & \(64\times 64\times 10\) \\ \hline
5 & 2-D Convolution & \(64\times 64\times 20\) \\ \hline
6 & Batch Normalization & \(64\times 64\times 20\) \\ \hline
7 & 2-D Max Pooling & \(32\times 32\times 20\) \\ \hline
8 & 2-D Convolution & \(32\times 32\times 64\) \\ \hline
9 & Batch Normalization & \(32\times 32\times 64\) \\ \hline
10 & 2-D Max Pooling & \(16\times 16\times 64\) \\ \hline
11 & 2-D Convolution & \(16\times 16\times 30\) \\ \hline
12 & Batch Normalization & \(16\times 16\times 30\) \\ \hline
13 & Fully Connected & \(1\times 1\times 3\) \\ \hline
14 & SoftMax & \(1\times 1\times 3\) \\ \hline
15 & Classification Output & \(1\times 1\times 3\) \\ \hline \hline Maximum number of learnable parameters & 69,602 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Network structure. and efficiency for deployment in embedded systems. On the other hand, VGG16 has a huge size of 476 MB with an increased accuracy of merely 1.6%  
The compact architecture reduces the overall memory footprint, making it well-suited for devices with limited storage capacity and computational resources. The reduced model size facilitates quicker deployment and lower latency in real-time applications in addition to energy efficiency. Moreover, the reduced model size not only facilitates integration into portable devices but also contributes to faster classification, allowing for rapid lithological analysis at the point of data collection, where real-time identification of rock types can significantly impact decision-making processes. In such a system, a lithology classifier can be inserted in the drill core for the purpose of real-time lithology classification inside the hole, which saves time and cost compared to lithology core extraction. Figure 3 depicts the confusion matrices across all CNN models. The best result was recorded with DarkNet-53 with an accuracy of 99.2% followed by a similar performance of both DarkNet-19 and VGG19. A slightly lower accuracy of 96.4% was recorded with Alexnet and RestNet-50. The proposed method achieved a similar performance to the aforementioned networks with the benefit of being lightweight. Table 6 gives the average precision, recall and F1-score across the employed CNN models in this work.