Lung diseases significantly impact the world regarding health, economic cost, and social and psychological well-being. X-ray images are a primary method for diagnosing lung diseases, but the manual analysis of these images can be time-consuming, subjective, and prone to inaccuracies. However, it is essential to diagnose lung diseases in a timely manner and with high accuracy to ensure effective treatment and management. This study introduces an innovative deep-learning version termed the "ESSDN-LN model" to overcome these challenges. It is a variant of the single shot detector (SSD) network. This model aims to rapidly and accurately detect and classify six types of lung disease: aortic enlargement, cardiomegaly, pleural thickening, pulmonary fibrosis, COVID-19, and pneumonia. The ESSDN-LD model was introduced in three versions: ESSDN-LDV1, ESSDN-LDV2, and ESSDN-LDV3. ESSDN-LDV1 incorporates the SSD with batch normalization, dropout regularization, and data augmentation techniques. ESSDN-LDV2 builds upon the advancements of ESSDN-LDV1 by incorporating the random search algorithm for adjusting model hyperparameters and introducing the skip connections technique to enhance the detection performance. Furthermore, ESSDN-LDV3 further enhances the capabilities of ESSDN-LDV1 using the genetic algorithm for hyperparameter tuning and incorporating feature fusion and skip connections techniques, thereby significantly improving the detection performance. The ESSDN-LDV3 model demonstrated exceptional performance compared to other versions, achieving a remarkable accuracy of 96.5% and a prediction time of 0.018 seconds in the seven-class classification. Furthermore, it achieved a total accuracy of 98.4% and a prediction time of 0.013 seconds in the three-class classification, encompassing Covid-19, pneumonia, and no-finding cases. These impressive results highlight the effectiveness and efficiency of the proposed method in accurately classifying lung diseases and can contribute to improved patient outcomes and treatment decisions.