Human eyesight depends significantly on retinal tissue. The loss of eyesight may result from infections of the retinal tissue that are treated slowly or not at all. Furthermore, when a large dataset is involved, the diagnosis is susceptible to inaccuracies. Hence, a fully automated approach based on deep learning for diagnosing retinal illness is proposed in order to minimise human intervention while maintaining high precision in classification. The proposed Attention UNet++ based Deep Retinal Network (Attn_UNet++ based DeepRetNet) is designed for classifying the retinal disease along with the segmentation criteria. In this, the Attn_UNet++ is employed for segmentation, wherein the UNet++ with dense connection is hybridized with Attention module for enhancing the segmentation accuracy. Then, the disease classification is performed using the DeepRetNet, wherein the loss function optimization is employed using the Improved Gazelle optimization (ImGaO) algorithm. Here, the adaptive weighting strategy is added with the conventional Gazelle algorithm for enhancing the global search with fast convergence rate. The performance analysis of proposed Attn_UNet++ based DeepRetNet based on Accuracy, Specificity, Precision, Recall, F1-Measure, and MSE accomplished the values of 97.20%, 98.36%, 95.90%, 95.50%, 96.53%, and 2.80% respectively.