Glaucoma is a retinal disease that damages the eye's optic nerve, frequently causing an irreversible loss of vision. However, the accurate diagnosis of this disease is difficult but early-stage diagnosis may cure this retinal disease. The objective of this research is to diagnose glaucoma disease in the top of the eye's optical nerve. The proposed approach detects glaucoma via four major steps namely Data enhancement phase, segmentation phase, feature extraction phase, and classification phase by the fractional gravitational search-based hybrid deep neural network (FGSA-HDNN) classifier. The proposed classifier is used for the exact classification of glaucoma infected images and normal images. Here, the proposed approach utilizes the statistical, textural, and vessel features from the segmented output. Also, the proposed FGSO algorithm is used for testing the deep neural network. From the experimental results, it is observed that the proposed glaucoma detection has obtained a sensitivity of 99.64%, a specificity of 97.84%, and an accuracy of 98.75% that outperforms other state-of-art methods.