Eye diseases have been a severe problem worldwide, especially in developing countries where technology and finance are limited. Today, the problem is being resolved thanks to pattern classification that is part of pattern recognition, and its primary goal is to group standard features from any entity, object, phenomenon, or event belonging to the real or abstract world. Convolutional Neural Networks are a type of Artificial Neural Network that is much used in intelligent pattern classification, learning machine, and data mining. Also, these algorithms are applied in medicine and ophthalmology for detecting diseases in the human body. This work presents a novel intelligent pattern classification algorithm based on a convolutional neural network, which is validated through the K-Fold Cross Validation test. Two different groups of retinography images are given: Glaucoma and Diabetic Retinopathy. The result of accuracy percentage was of 99.89%. Numerical metrics: Accuracy, Recall, Specificity Precision and F1score with values close to 1, and ROC curves support the suitable performance of the proposed classifier.