Biomedical image processing is finding useful in healthcare sector for the investigation, enhancement, and display of images gathered by distinct imaging technologies. Diabetic retinopathy (DR) is an illness caused by diabetes complications and leads to irreversible injury to the retina blood vessels. Retinal vessel segmentation techniques are a basic element of automated retinal disease screening system. In this view, this study presents a novel blood vessel segmentation with deep learning based classification (BVS-DLC) model for DR diagnosis using retinal fundus images. The proposed BVS-DLC model involves different stages of operations such as preprocessing, segmentation, feature extraction, and classification. Primarily, the proposed model uses the median filtering (MF) technique to remove the noise that exists in the image. In addition, a multilevel thresholding based blood vessel segmentation process using seagull optimization (SGO) with Kapur's entropy is performed. Moreover, the shark optimization algorithm (SOA) with Capsule Networks (CapsNet) model with softmax layer is employed for DR detection and classification. A wide range of simulations was performed on the MESSIDOR dataset and the results are investigated interms of different measures. The simulation results ensured the better performance of the proposed model compared to other existing techniques interms of sensitivity, specificity, receiver operating characteristic (ROC) curve, accuracy, and F-score.