Early diagnosis of infective keratitis is critical as it is a vision-threatening condition that can lead to significant vision loss and ocular morbidity. Diagnosis of infective keratitis done through clinical findings and slit- lamp examination is intricate and requires high expertise. Most infective keratitis cases are challenging to the clinicians. This paper proposes a deep learning approach enabling a more accurate diagnoses and treatment of infective keratitis. As a first step towards developing a comprehensive deep learning-based disease detection tool, we have classified bacterial and viral keratitis based on slit-lamp images and convolutional neutral network. A total of 446 keratitis images (bacterial - 271 and viral - 175) were available for the study. The experiment was conducted with different CNN configurations: with different input shape (image sizes: 64x64, 128x128, 256x256, 400x400) with two and three convolution layers. Image size 64x64 with three convolutional layer and no pooling achieved the highest performance (sensitivity =0.715, specificity= 0.880, precision= 0.807, accuracy= 0.812 and AUC=0.856). Experimental results show that even with a small dataset CNN was able to produce a good classification result.