Abstract:The scarcity of labeled slit-lamp images severely limits the generalization of artificial intelligence models for keratitis recognition. Medical image annotation is typically time-consuming and labor-intensive, and data privacy concerns further exacerbate the challenge of insufficient labeled data. To address this issue, this study proposes a novel semi-supervised learning (SSL) algorithm based on the local consistency strategy (LCS), LCSFixMatch, for automated keratitis grading. LCSFixMatch first employs information entropy to filter out low-quality unlabeled slit-lamp images and then leverages the Kullback–Leibler (KL) divergence between weakly and strongly augmented images to select high-quality unlabeled samples, thereby alleviating the scarcity of labeled data. During training, the KL divergence threshold is dynamically adjusted according to validation set performance to control the selection strength of high-quality unlabeled samples. Additionally, a squeeze-and-excitation (SE) module is embedded in the DenseNet121 to enhance the extraction of features related to keratitis lesions and associated complications. The model was developed and evaluated on 17,255 slit-lamp images collected from Ningbo Eye Hospital of Wenzhou Medical University. Experimental results demonstrate that the proposed LCSFixMatch algorithm achieves superior performance in the automatic identification of four keratitis subtypes, outperforming conventional convolutional neural networks and state-of-the-art SSL algorithms. This study presents a feasible and effective automated solution for keratitis grading, effectively addressing the practical challenge of limited labeled slit-lamp images.