International Diabetes Federation (IDF) reports that diabetes is a rapidly growing illness. About 463 million adults between 20-79 years have diabetes. There are also millions of undiagnosed patients. It is estimated that there will be about 578 million diabetics by 2030 . Diabetes reasons different eye diseases. Diabetic retinopathy (DR) is one of them and is also one of the most common vision loss or blindness worldwide. DR progresses slowly and has few indicators in the early stages. It makes the diagnosis of DR a problematic task. Automated systems promise to support the diagnosis of DR. Many deep learning-based models have been developed for DR classification. This study aims to support ophthalmologists in the diagnosis process and increase the diagnosis performance of DR through a hybrid model. A publicly available Messidor-2 dataset was used in this study, comprised of retinal images. In the proposed model, images were pre-processed, and a deep learning model, namely, InceptionV3, was used in feature extraction, where a transfer learning approach is applied. Next, the number of features in obtained feature vectors was decreased with feature selection by Simulated Annealing. Lastly, the best representation features were used in the XGBoost model. The XGBoost algorithm gives an accuracy of 92.55% in a binary classification task. This study shows that a pre-trained ConvNet with a metaheuristic algorithm for feature selection gives a satisfactory result in the diagnosis of DR.