Diabetic retinopathy, known as one of the most crucial neurovascular barriers to diabetes, has affected the retina, leading to a potential risk of blindness. The harm is not isolated to personal health, with negative effects felt at the economic and social level in entire communities. The consequences of vision loss secondary to diabetic retinopathy on quality of life, independent living, and employment can be significant. It is necessary to adopt a comprehensive approach for effective management of underlying diabetes, which includes early detection, timely intervention, supportive care, and management of comorbid conditions. Critical to this is a precise classification of its stages for disease analysis. A manual diagnosis, on the other hand, requires qualified individuals to recognize the subtle nuances of the condition, making it a lengthy process. This study aims to develop a computer-assisted system for analyzing retinal fundus images to identify and classify different stages of diabetic retinopathy. A dataset of eye fundus images was used by the proposed network to classify the presence and severity of blindness and its stages. The proposed model uses a non-uniform squash function in capsule neural networks. The motive behind employing a non-uniform squash function was to encourage the model to allocate greater attention and stability to intricate images throughout the training phase. The proposed model's efficiency is assessed meticulously with pre-trained CNN methods like InceptionV3, VGG16, VGG19, and Xception. The proposed capsule network model has been revamped to address the shortcomings of prior research with care. The method stands out with an impressive 99.84 % training accuracy and 98.68 % validation accuracy. Diabetic retinopathy, though rare in occurrence, poses significant challenges due to the high cost of diagnosis, rendering it inaccessible to rural and remote communities with limited access to tests and check-ups.