Heart disease is a worldwide health issue that is more common in places like South Asia, Eastern Europe, and Russia because of a mix of lifestyle, nutrition, genetic, and healthcare access factors. Heart attacks, a prevalent symptom of heart disease, account for 29% of deaths globally, which is a substantial contribution to global mortality. With an estimated 47 fatalities each hour, heart attacks account for 19% of all deaths in Pakistan, which ranks 18th in the world for heart attack-related mortality. This work suggests a unique method for detecting cardiac illness using advanced deep learning architectures, namely DeepLabV3Plus CNN models and VGG19. This is in response to these issues. These architectures are appropriate for cardiac segmentation and classification tasks utilizing X-ray image datasets because they strike a compromise between computational efficiency and accuracy. The DeepLabV3Plus model in particular shows remarkable performance with 98% accuracy while requiring fewer parameters. A 95% accuracy rate was obtained in the first trials using VGG19, proving the effectiveness of the suggested strategy in obtaining good diagnostic precision with little processing cost. Healthcare practitioners may improve cardiac diagnosis and treatment planning by utilizing these advanced approaches. This will eventually improve patient outcomes and lessen the impact of heart disease on impacted populations.