Computer vision has gained momentum in medical imaging tasks. Deep learning and Transfer learning are some of the approaches used in computer vision. The aim of this research was to do a comparative study of deep learning and transfer learning in the detection of diabetic retinopathy. To achieve this objective, experiments were conducted that involved training four state-of-the-art neural network architectures namely; EfficientNetB0, DenseNet169, VGG16, and ResNet50. Deep learning involved training the architectures from scratch. Transfer learning involved using the architectures which are pre-trained using the ImageNet dataset and then fine-tuning them to solve the task at hand. The results show that transfer learning outperforms learning from scratch in all three models. VGG16 achieved the highest accuracy of 84.12% in transfer learning. Another notable finding is that transfer learning is able to not only achieve high accuracy with very few epochs but also starts higher than deep learning in the first epoch. This study has also demonstrated that in image processing tasks there are a lot of transferrable features since the ImageNet weights worked well in the Diabetic retinopathy detection task.