Glaucoma, a progressive eye disease, leads to irreversible vision loss due to optic nerve damage. This study aims to develop a more explainable and interpretable deep learning-based model for the detection and classification of glaucoma, addressing the current limitations in the field. The proposed approach utilizes a modified DenseNet-201 architecture, incorporating an additional transition layer for enhanced glaucoma classification. A pre-trained Efficient DenseNet is applied, and a reweighted cross-entropy loss function is used to handle the class imbalance in the training data. Quantum-based Dwarf Mongoose Optimization (QDMOA) is employed to fine-tune the model’s parameters, minimizing over fitting and improving generalization on small datasets. Experimental results demonstrate that the proposed method effectively detects and classifies two types of glaucoma. The use of dense connections with regularization significantly reduces over fitting, and the reweighted loss function improves model performance on imbalanced data. The developed deep learning model offers improved accuracy in glaucoma detection and classification while addressing the need for more interpretable and reliable models in medical applications. This research provides a practical tool for automated glaucoma screening, which could support ophthalmologists in early diagnosis and treatment, reducing the risk of irreversible vision loss.