In this article, we aimed to diagnose whether patients have bacterial pharyngitis or nonbacterial pharyngitis. To achieve this, a dataset from 579 patients was collected, and at least four general practitioners diagnosed each sample. Data augmentation methods were employed to increase the sample size, and various preprocessing techniques were applied to enhance the quality of images. In this study, we utilized a Convolutional Neural Network (CNN) and two transformers for binary classification. The results show that deep learning classifiy the pharyngitis into bacterial and nonbacterial, based on images taken by smartphone cameras, precisely.