Dental caries is arguably the most persistent dental condition that affects most people over their lives. Carious lesions are commonly diagnosed by dentists using clinical and visual examination along with oral radiographs. In many circumstances, dental caries is challenging to detect with photography and might be mistaken as shadows for various reasons, including poor photo quality. However, with the introduction of Artificial Intelligence and robotic systems in dentistry, photographs can be a helpful tool in oral epidemiological research for the assessment of dental caries prevalence among the population. It can be used particularly to create a new automated approach to calculate DMF (Decay, Missing, Filled) index score. In this paper, an autonomous diagnostic approach for detecting dental cavities in photos is developed using deep learning algorithms and ensemble methods. The proposed technique employs a set of pretrained models including Xception, VGG16, VGG19, and DenseNet121 to extract essential characteristics from photographs and to classify images as either normal or caries. Then, two ensemble learning methods, E- majority and E-sum, are employed based on majority voting and sum rule to boost the performances of the individual pretrained model. Experiments are conducted on 50 images with data augmentation for normal and caries images, the employed E-majority and E-sum achieved an accuracy score of 96% and 97%, respectively. The obtained results demonstrate the superiority of the proposed ensemble framework in the detection of caries. Furthermore, this framework is a step toward constructing a fully automated, efficient decision support system to be used in the dentistry area.