Computed tomography (CT) scans, or radiographic images, were used to aid in the early diagnosis of patients and detect normal and abnormal lung function in the human chest. However, the diagnosis of lungs infected with coronavirus disease 2019 (COVID-19) was made more accurately from CT scan data than from a swab test. This study uses human chest radiography pictures to identify and categorize normal lungs, lung opacities, COVID-19-infected lungs, and viral pneumonia (often called pneumonia). In the past, several CAD systems using image processing, ML/DL, and other forms of machine learning have been developed. However, those CAD systems did not provide a general solution, required huge hyper-parameters, and were computationally inefficient to process huge datasets. Moreover, the DL models required high computational complexity, which requires a huge memory cost, and the complexity of the experimental materials' backgrounds, which makes it difficult to train an efficient model. To address these issues, we developed the Inception module, which was improved to recognize and detect four classes of Chest X-ray in this research by substituting the original convolutions with an architecture based on modified-Xception (m-Xception). In addition, the model incorporates depth-separable convolution layers within the convolution layer, interlinked by linear residuals. The model's training utilized a two-stage transfer learning process to produce an effective model. Finally, we used the XgBoost classifier to recognize multiple classes of chest X-rays. To evaluate the m-Xception model, the 1095 dataset was converted using a data augmentation technique into 48,000 X-ray images, including 12,000 normal, 12,000 pneumonia, 12,000 COVID-19 images, and 12,000 lung opacity images. To balance these classes, we used a data augmentation technique. Using public datasets with three distinct train-test divisions (80-20%, 70-30%, and 60-40%) to evaluate our work, we attained an average of 96.5% accuracy, 96% F1 score, 96% recall, and 96% precision. A comparative analysis demonstrates that the m-Xception method outperforms comparable existing methods. The results of the experiments indicate that the proposed approach is intended to assist radiologists in better diagnosing different lung diseases.