This study addresses the escalating prevalence of diabetic retinopathy (DR) and glaucoma, major global causes of vision impairment. We propose an innovative iterative Q-learning model that integrates with fuzzy C-means clustering to improve diagnostic accuracy and classification speed. Traditional diagnostic frameworks often struggle with accuracy and delay in disease stage classification, particularly in discerning complex features like exudates and veins. Our model overcomes these challenges by combining fuzzy C means with Q learning, enhancing precision in identifying key retinal components. The core of our approach is a custom-designed 45-layer 2D convolutional neural network (CNN) optimized for nuanced detection of DR and glaucoma stages. Compared to previous approaches, the performance on the IDRID and SMDG-19 datasets and associated samples shows a 10.9% rise in precision, an 8.5% improvement in overall accuracy, an 8.3% enhancement in recall, a 10.4% larger area under the curve (AUC), a 5.9% boost in specificity, and a 2.9% decrease in latency. This methodology has the potential to bring about significant changes in the field of DR and glaucoma diagnosis, leading to prompt medical interventions and possibly decreasing vision loss. The use of sophisticated machine learning techniques in medical imaging establishes a model for future investigations in ophthalmology and other clinical situations.