Recent developments in deep-learning techniques have led to significant progress in the field of imaging, including segmentation and classification. The analysis of medical imaging, such as X-ray imaging of the lungs, is one of the most popular deep-learning applications. Deep learning can automatically extract features from data, whereas conventional computer vision methods depend on manually created features. Researchers have suggested merging the generative and discriminative learning approaches to overcome issues such as the difficulty of lung nodule delineation due to a wide range of shape and texture variations and the visual similarities shared by malignant and benign nodules. The proposed method combines these two methods to enhance categorisation and improve the overall performance of the system.