  Failure to recognize samples from the classes unseen during training is a
major limitation of artificial intelligence in the real-world implementation
for recognition and classification of retinal anomalies. We established an
uncertainty-inspired open-set (UIOS) model, which was trained with fundus
images of 9 retinal conditions. Besides assessing the probability of each
category, UIOS also calculated an uncertainty score to express its confidence.
Our UIOS model with thresholding strategy achieved an F1 score of 99.55%,
97.01% and 91.91% for the internal testing set, external target categories
(TC)-JSIEC dataset and TC-unseen testing set, respectively, compared to the F1
score of 92.20%, 80.69% and 64.74% by the standard AI model. Furthermore, UIOS
correctly predicted high uncertainty scores, which would prompt the need for a
manual check in the datasets of non-target categories retinal diseases,
low-quality fundus images, and non-fundus images. UIOS provides a robust method
for real-world screening of retinal anomalies.
