The most effective treatment for diabetic retinopathy (DR) is the early detection through regular screening, which is critical for a better prognosis. Automatic screening of the images would assist the physicians in diagnosing the condition of patients easily and accurately. This condition searches out for special importance of image processing technology in the way of processing the retinal fundus images. Accordingly, this article plans to develop an automatic DR detection model with the aid of three main stages like (a) image preprocessing, (b) blood vessel segmentation, and (c) classification. The preprocessing phase includes two steps: conversion of RGB to Lab, and contrast enhancement. The Histogram equalization process is done using the contrast enhancement of an image. To the next of preprocessing, the segmentation phase starts with a valuable procedure. It includes (a), thresholding the contrast‐enhanced and filtered images, (b) thresholding the keypoints of contrast‐enhanced and filtered images, and (c) adding both thresholded binary images. Here, the filtering process is performed by proposed adaptive average filtering, where the filter coefficients are tuned or optimized by an improved meta‐heuristic algorithm called fitness probability‐based CSO (FP‐CSO). Finally, the classification part uses Deep CNN, where the improvement is exploited on the convolutional layer, which is optimized by the same improved FP‐CSO. Since the conventional CSO depends on a fitness probability in the improved algorithm, the proposed algorithm termed as FP‐CSO. Finally, valuable comparative and performance analysis has confirmed the effectiveness of the proposed model.