The deep learning method is a promising computational technique, especially for image classification problems. One of them is the Convolutional Neural Network (CNN), which is the most popular neural network model used and can understand enough the data. Although CNN is highly accurate, overfitting is a problem that frequently occurred. It could prevent it by optimizing the CNN method using diffGrad optimizer to overcome it. The proposed algorithm performance was validated using the cataract dataset. A cataract is an eye disease that has a clouding of the lens that affects the vision, and it is hard to detect at first. This research purpose is to classify the fundus image of cataract using CNN and optimize it using diffGrad optimizer. Finally, from the simulation results on the data from the Kaggle dataseis, it is shown that the proposed algorithm can classify the data into two classes. The classes are normal fundus images and cataract fundus images. Also, diffGrad optimizers can increase the accuracy of the classification.