Diabetic retinopathy (DR) is a common complication of diabetes mellitus, and retinal blood vessel damage can lead to vision loss and blindness if not recognized at an early stage. Manual DR detection using large fundus image data is time-consuming and error-prone. An effective automatic DR detection system can be significantly faster and potentially more accurate. This study aims to classify fundus images into five DR classes, using deep learning methods, with the highest possible accuracy and the lowest possible computational time. Three distinct DR datasets, APTOS, Messidor2, and IDRiD, are merged, resulting in 5,819 raw images. Before training the model, various image preprocessing techniques are applied to remove artifacts and noise from the images and improve their quality. Three augmentation techniques: geometric, photometric, and elastic deformation, are used to create a balanced dataset. A shallow convolutional neural network (CNN) is developed using three blocks of convolutional layers and maxpool layers with a categorical cross-entropy loss function, Adam optimizer, 0.0001 learning rate, and 64 batch size as a base model, and this is also employed to determine the best data augmentation method for further processing. A study to optimize the performance is then conducted by changing different components and hyperparameters of the base model, resulting in our proposed RetNet-10 model. Six cutting-edge models are employed for comparison. Our proposed RetNet-10 model performed the best, with a testing accuracy of 98.65%. MobileNetV2, VGG16, Xception, VGG19, InceptionV3 and ResNet50 achieved testing accuracies of 91.42%, 90.16%,89.57%, 88.21%, 87.68% and 87.23%, respectively. The model is also trained with several k values to assess its robustness. After image processing and data augmentation, using the combined dataset, and fine-tuning the base model, our proposed RetNet-10 model outperformed other automated methods for DR diagnosis.