This research introduces a hybrid deep learning algorithm, CAPSGNN, combining Capsule Networks (CapsNet) and Graph Neural Networks (GNN) to enhance medical image classification. The proposed approach addresses limitations of conventional CNNs, such as feature loss and inefficiency, by integrating capsule-based dynamic routing and graph-based contextual analysis. By leveraging X-ray image nodes and edges for targeted classification, CAPSGNN reduces training time, improves diagnostic accuracy, and accelerates disease detection in healthcare. This innovation streamlines medical workflows, providing a scalable solution for real-time medical imaging analysis.