Pneumonia is a form of acute respiratory infection affecting the lungs. Symptoms of viral and bacterial pneumonia are similar. Rapid diagnosis of the disease is difficult, since polymerase chain reaction-based methods, which have the greatest reliability, provide results in a few hours, while ensuring high requirements for compliance with the analysis technology and professionalism of the personnel. This study proposed a Concatenated CNN model for pneumonia detection combined with a fuzzy logic-based image improvement method. The fuzzy logic-based image enhancement process is based on a new fuzzification refinement algorithm, with significantly improved image quality and feature extraction for the CCNN model. Four datasets, original and upgraded images utilizing fuzzy entropy, standard deviation, and histogram equalization, were utilized to train the algorithm. The CCNN's performance was demonstrated to be significantly improved by the upgraded datasets, with the fuzzy entropy-added dataset producing the best results. The suggested CCNN attained remarkable classification metrics, including 98.9% accuracy, 99.3% precision, 99.8% F1-score, and 99.6% recall. Experimental comparisons showed that the fuzzy logic-based enhancement worked significantly better than traditional image enhancement methods, resulting in higher diagnostic precision. This study demonstrates how well deep learning models and sophisticated image enhancement techniques work together to analyze medical images.