The pharynx is one of the few areas in the body where blood vessels and immune tissues can readily be observed from outside the body non-invasively. Although prior studies have found that sex could be identified from retinal images using artificial intelligence, it remains unknown as to whether individuals’ sex could also be identified using pharyngeal images. Demographic information and pharyngeal images were collected from patients who visited 64 primary care clinics in Japan for influenza-like symptoms. We trained a deep learning-based classification model to predict reported sex, which incorporated a multiple instance convolutional neural network, on 20,319 images from 51 clinics. Validation was performed using 4869 images from the remaining 13 clinics not used for the training. The performance of the classification model was assessed using the area under the receiver operating characteristic curve. To interpret the model, we proposed a framework that combines a saliency map and organ segmentation map to quantitatively evaluate salient regions. The model achieved the area under the receiver operating characteristic curve of 0.883 (95% CI 0.866–0.900). In subgroup analyses, a substantial improvement in classification performance was observed for individuals aged 20 and older, indicating that sex-specific patterns between women and men may manifest as humans age (e.g., may manifest after puberty). The saliency map suggested the model primarily focused on the posterior pharyngeal wall and the uvula. Our study revealed the potential utility of pharyngeal images by accurately identifying individuals’ reported sex using deep learning algorithm.