COVID-19 is a rapidly proliferating transmissible virus that substantially impacts the world population. Consequently, there is an increasing demand for fast testing, diagnosis, and treatment. However, there is a growing need for quick testing, diagnosis, and treatment. In order to treat infected individuals, stop the spread of the disease, and cure severe pneumonia, early covid-19 detection is crucial. Along with covid-19, various pneumonia etiologies, including tuberculosis, provide additional difficulties for the medical system. In this study, covid-19, pneumonia, tuberculosis, and other specific diseases are categorized using Sharpened Cosine Similarity Network (SCS-Net) rather than dot products in neural networks. In order to benchmark the SCS-Net, the model’s performance is evaluated on binary class (covid-19 and normal), and four-class (tuberculosis, covid-19, pneumonia, and normal) based X-ray images. The proposed SCS-Net for distinguishing various lung disorders has been successfully validated. In multiclass classification, the proposed SCS-Net succeeded with an accuracy of 94.05% and a Cohen’s kappa score of 90.70% ; in binary class, it achieved an accuracy of 96.67% and its Cohen’s kappa score of 93.70%. According to our investigation, SCS in deep neural networks significantly lowers the test error with lower divergence. SCS significantly increases classification accuracy in neural networks and speeds up training.