Breast cancer remains a pervasive global health issue, affecting diverse populations worldwide and posing significant challenges for public health. As the most common cancer among women worldwide, breast cancer also occasionally affects men. The gravity of the disease and the urgency for effective treatment are underscored by its high mortality rate. Traditionally, breast cancer detection relies on human radiologists who analyze mammograms to classify breast masses and subsequently provide treatment recommendations based on the diagnostic assessments. However, the exclusive reliance on human radiologists for breast mass classification can lead to diagnostic inconsistencies, human errors, and delays in timely care, potentially resulting in missed or incorrect diagnoses and exacerbating healthcare disparities. Enhancing the mammogram classification process through the development and implementation of computer-aided diagnosis (CAD) systems can address these challenges. By improving the accuracy, efficiency, and consistency of CAD systems, the likelihood of human error is reduced, and a standardized approach to analysis is provided, offering crucial support to radiologists, particularly in complex cases. This article introduces a novel approach, termed MammoDenseInvoNet, which leverages the combined power of deep convolutional neural networks (CNNs) and involution neural networks (INNs) for precise and automated classification of breast masses. The study explores three distinct mammography datasets: the Digital Database for Screening Mammography (DDSM), the King Abdulaziz University Breast Cancer Mammography Dataset (KAU-BCMD) and a privately collected dataset named PioneerMammoBD. The images from these datasets are categorized into benign and malignant classes. The proposed architecture employs the DenseNet169 model as a feature extractor, incorporating a custom involution layer that adaptively generates kernels based on input features. The robustness of the MammoDenseInvoNet model is evaluated through various performance metrics and experiments, where it notably surpasses other models, achieving an impressive average accuracy of 97.58%. Specifically, the individual highest accuracies for the PioneerMammoBD, DDSM, and KAU-BCMD datasets are 98%, 100%, and 97%, respectively.