In this study, efficient deep transfer learning models are proposed to classify six types of volcanic rocks, and this paper has a novelty in classifying volcanic rock types for the first time using thin section images. Convolutional neural network-based DenseNet121 and ResNet50 networks, which are transfer learning methods, are used to extract the features from thin section images of rocks, and the classification process is carried out with a single-layer fully connected neural network. The proposed models are trained and tested on 1200 thin section images using four different optimizers (Adadelta, ADAM, RMSprop, SGD). AUC, accuracy, precision, recall and f1-score are used as performance metrics. Proposed models are run 10 times for each optimizer. DenseNet121 classifies volcanic rock types using RMSprop with an average accuracy of 99.50% and a maximum of 100.00%, and ResNet50 classifies using ADAM with an average accuracy of 98.80% and a maximum of 99.72%. Thus, the applied deep transfer learning is promising in geosciences and can be used to identify rock types quickly and accurately.