Machine learning has attracted the attention of geoscientists over the years. In particular, image analysis via machine learning has promise for application to exploration and production technologies. Demands have grown for the automation of carbonate lithology identification to shorten the delivery time of work and to enable unspecialized engineers to conduct it. The image analysis of carbonate thin sections is time consuming and requires expert knowledge of carbonate sedimentology. In this study, the authors propose an image analysis technique based on deep neural network for carbonate lithology identification of a thin section, which is an important image analysis process required for oil and gas exploration. In addition, the authors consider that porosity and permeability variations in the same facies are controlled by the grain, cement, pore, and limemud contents. If the contents are accurately measured, the porosity and permeability can be determined more accurately than by using traditional methods such as point counting. The elucidation of the complex relation of porosity and permeability is the objective of automation of carbonate lithology identification. To perform image analysis of the thin section, the authors prepared a data set mainly comprising pictures of the Pleistocene Ryukyu Group, which were composed of reef complex deposits distributed in southern Japan. The data set contains 306 thin section pictures and annotation data labeled by a carbonate sedimentologist. The rock components was divided into four types (grain, cement, pore, and limemud). A convolution neural network (CNN) was utilized to train the model. After training the neural network, each of the four categories was interpreted by the trained model automatically. Resultantly, the accuracy of automatic Dunham classification was 90.6% and the mean average test accuracy of category identification was 83.9%. The interpretation seems highly consistent between human vision and machine vision in both the overview and pixelwise scales. This result indicates that it has sufficient potential to assist geologists and become a basic tool for practical applications. However, the accuracy of category identification is still insufficient. The authors believe that the model requires higher quality supervised data and a greater number of supervised data.