Background: Deep learning technologies, especially Convolutional Neural Networks (CNNs), are revolutionizing the field of medical imaging by providing advanced tools for the accurate classification of pulmonary diseases from chest X-ray (CXR) images. In our study, we employed both traditional CNN models and MobileNet architectures to classify various chest diseases using CXR images. Initially, a conventional CNN model was utilized to estab- lish a baseline accuracy. Subsequently, we adopted MobileNet, known for its efficiency in processing image data, to enhance classification performance. To further optimize the system, we applied Energy Valley Optimization (EVO) for hyperparameter tuning. The baseline CNN model achieved an accuracy of 85.91%. The implementation of MobileNet significantly improved this metric, reaching a pre-optimization accuracy of 93.30%. Post-EVO optimization, the accuracy was further enhanced to 94.18%. Comparative analysis of accuracy, precision, recall, F1-score, and ROC curves was conducted to illustrate the impact of hyperparameter tuning on model performance in medical diagnostics. Our findings demonstrate that while standard CNNs provide a solid foundation for CXR image classification, the integration of MobileNet architectures and EVO for hyperparameter adjustment significantly boosts diagnostic accuracy. This advancement in automated medical image analysis could potentially transform the landscape of pulmonary disease diagnosis, offering a more robust framework for accurate and efficient patient care.