Depression is a widespread mental disorder with inconsistent symptoms that make diagnosis challenging in clinical practice and research. Nevertheless, the poor identification may be partially explained by the fact that present approaches ignore patients' vocal tract modifications in favour of merely considering speech perception aspects. This study proposes a novel framework, KWHO-CNN, integrating a hybrid metaheuristic algorithm with Attention-Driven Convolutional Neural Networks (CNNs), to enhance depression detection using speech data. It addresses challenges like variability in speech patterns and small sample sizes by optimizing feature selection and classification. Initial pre-processing involves noise reduction, data normalization, and segmentation, followed by feature extraction, primarily utilizing Mel-frequency cepstral coefficients (MFCCs). The Krill Wolf Hybrid Optimization (KWHO) Algorithm optimizes these features, overcoming issues of over-fitting and enhancing model performance. The Attention-Driven CNN architecture further refines classification, leveraging dense computations and architectural homogeneity. The suggested model outperforms in depression diagnosis, with over 90% accuracy, precision, recall, and F1 score, demonstrating its potential to greatly impact clinical practice and mental health research.