Diagnosing and treating diabetic retinopathy (DR) early on can prevent vision loss. None, moderate, mild, proliferate, and severe are the top five DR phases. This work presents a deep learning (DL) model that identifies all five stages of DR more accurately than earlier approaches. the suggested method with image enhancement using a contrast limited adaptive histogram equalization (CLAHE) filtering algorithm in conjunction with an enhanced super-resolution generative adversarial network (ESRGAN), and circular mask with using random search for hyperparameter. The next step was using augmentation techniques to create a balanced dataset using the same parameters for both scenarios. The created model outperformed previous techniques for identifying the five stages of DR, with an accuracy of 90% , using Efficient net B3 applied to the Asia Pacific TeleOphthalmology Society (APTOS) datasets.