Abstract
Rock Classification is an essential geological problem since it provides important formation information. However, exploration on this problem using convolutional neural networks is not sufficient. To tackle this problem, we propose two approaches using residual neural networks. We first adopt data augmentation methods to enlarge our dataset. By modifying kernel sizes, normalization methods and composition based on ResNet34, we achieve an accuracy of 70.1% on the test dataset, with an increase of 3.5% compared to regular Resnet34. Furthermore, using a similar backbone like BoTNet that incorporates multihead self attention, we additionally use internal residual connections in our model. This boosts the model's performance, achieving an accuracy of 73.7% on the test dataset. We also explore how the number of bottleneck transformer blocks may influence model performance. We discover that models with more than one bottleneck transformer block may not further improve performance. Finally, we believe that our approach can inspire future work related to this problem and our model design can facilitate the development of new residual model architectures.
Introduction
Identifying rock types is a foundational task in geology, essential for understanding formation history and resource exploration. Traditionally, this requires human experts to perform time-consuming visual inspections. While Computer Vision (CV) is a natural fit for this task, geological datasets often suffer from a "small data" crisis. In this study, the authors addressed a dataset of 53 rock varieties where each class contained 40 or fewer images. Standard deep learning models typically fail to converge or overfit in such data-starved regimes. This paper explores architectural and training strategies to maximize performance on limited geological data.
Methodology
The researchers overhauled the standard ResNet-34 architecture through three primary strategies: data augmentation, kernel modification, and the introduction of Internal Residual Connections.
Data Augmentation
To combat the sparse dataset, a suite of transformations was applied to the training images. These included rotation, horizontal and vertical flipping, cropping, scaling, and color jittering (adjusting brightness, contrast, saturation, and hue). This step was critical, accounting for a massive 36% jump in classification accuracy over the baseline.
Architectural Modernization
Inspired by modern architectures like ConvNeXt, the ResNet "BasicBlock" was refined by:
- Replacing ReLU with GeLU (Gaussian Error Linear Units) for smoother gradients.
- Swapping Batch Normalization for Layer Normalization.
- Reducing activation functions and adding a 1x1 convolutional layer at the start of residual blocks to optimize parameter count and speed.
Internal Residual Connection (IRC)
The model integrates Multi-Head Self-Attention (MHSA) into the final layers, following a Bottleneck Transformer (BoTNet) approach. A key innovation is the Internal Residual Connection (IRC). While standard residual blocks skip the entire block, the IRC adds an extra skip connection specifically across the MHSA layer. This design forces the attention mechanism to learn the "second-order difference" of the data, simplifying the learning task.
Results and Discussion
The incremental improvements demonstrate the effectiveness of each design choice. Starting from a baseline ResNet-34 accuracy of 30.64%, the addition of data augmentation raised performance to 66.64%. Modernizing the kernels further increased accuracy to 70.1%. The final model, utilizing BoTNet with IRC, achieved the peak accuracy of 73.7%.
An interesting finding was that using a single Bottleneck Transformer block outperformed configurations with two blocks (73.7% vs 70.7%). This suggests that on small datasets, excessive attention mechanisms can lead to overfitting.
Conclusion
This research demonstrates that combining global context via Transformers with local feature extraction via CNNs, stabilized by Internal Residual Connections, is a potent strategy for niche image classification tasks. Future work will focus on expanding the dataset scale and exploring hybrid models that combine kernel modifications with IRC-enhanced transformer blocks to further push the boundaries of automated geological analysis.
Summary updated