Background: Although there have been reports of the successful diagnosis of skin disorders using deep learning, unrealistically large clinical image datasets are required for artificial intelligence (AI) training. Objectives: We created datasets of standardized nail images using region-based convolutional neural network (R-CNN) trained to distinguish the nail from the background. Methods: We used R-CNN to generate training datasets of 49,567 images, which we then used to fine-tune the ResNet-152 and VGG-19 models. The validation datasets comprised 100 and 194 images from Inje University (B1 and B2 datasets, respectively), 125 images from Hallym University (C dataset), and 939 images from Seoul National University (D dataset). Results: AI’s results showed test sensitivity/specificity/ area under the curve of (96.0 / 94.7 / 0.98), (82.7 / 96.7 / 0.95), (92.3 / 79.3 / 0.93), (87.7 / 69.3 / 0.82) for the B1, B2, C, and D datasets. For the B1 and C datasets, the AI’s Youden index was significantly (p = 0.01) higher than that of dermatologists. Conclusion: By training with a dataset comprising 49,567 images, we achieved a diagnostic accuracy for onychomycosis superior to that of most dermatologists who participated in this study.