In agriculture farming, pests and other plant diseases are the most imperative factor that causes significant hindrance to cucumber production and its quality. Farmers around the globe are currently facing difficulty in recognizing various cucumber leaf diseases, which is imperative to preventing leaf diseases effectively. Manual techniques to diagnose cucumber diseases are often time-consuming, subjective, and laborious. To address this issue, this paper proposes a tuned convolutional neural network (CNN) algorithm to recognise five cucumber diseases and healthy leaves that comprises image enhancement, feature extraction, and classification. Data augmentation methods were utilized as a preprocessing step to enlarge the datasets, and it was also to decrease the chance of overfitting. Automatically features are extracted by using CNN layers. Finally, five cucumber leaf diseases and one healthy leaf are classified. Furthermore, to overcome the lack of a public dataset, a new dataset of cucumber leaf diseases has been constructed that includes spider, leaf miner, downy mildew, powdery mildew, one viral disease, and healthy class leaves. The dataset has a total of 4868 cucumber leaf images. In order to prove the authenticity of the proposed CNN, comparative experiments were conducted using pretrained models (AlexNet, Inception-V3, and ResNet-50). The proposed CNN achieves a recognition accuracy of 98.19% with the augmented dataset and 100% with the publicly plant disease dataset. The experimental results confirm that the proposed CNN algorithm was efficient for recognizing the cucumber leaf diseases compared with other algorithms.