The integration of machine learning models into artificial intelligence has precipitated significant advancements in medical science. Notably, various programs have equipped radiologists with valuable tools to aid in medical image processing. Breast cancer stands out as the most prevalent cancer among women globally. The automated detection and classification of lesions in mammograms remain critical challenges necessitating more accurate diagnosis and meticulous examination of concerning lesions. Mammography is a pivotal diagnostic procedure for early breast cancer detection, enabling individuals to identify changes in their breasts far before they are palpable. In the relentless quest to improve patient care and tackle the prevalent ailments of our time, diverse fields such as data mining and artificial intelligence are making substantial contributions to breast cancer analysis. A groundbreaking investigation is currently focused on developing an innovative image processing technique aimed at detecting and grading breast cancer using mammogram and MRI images. This research relies on a unique image segmentation method utilizing a newly devised algorithm, coined CABC (Comprising Fuzzy C-Means and Artificial Bee Colony optimization). This inventive algorithm synergistically combines the benefits of FCM (Fuzzy C-Means) clustering and the robustness of Artificial Bee Colony (ABC) optimization. To determine the cancer stage, a random forest classifier is used, thereby enhancing the precision of the evaluation. The results stemming from the application of the CABC algorithm have demonstrated an impressive accuracy rate of 89.17%, attesting to the effectiveness of the proposed methodology. To thoroughly assess its performance, a comparative analysis has been conducted, involving other methodologies such as k-Means, Context-Based Clustering, Random Forest, and FCM individually. This rigorous evaluation employs both confusion matrix parameters and decision parameters, conclusively validating the superior performance of the proposed method. Essentially, this study exemplifies the synergistic collaboration between sophisticated image processing techniques, advanced clustering algorithms, and machine learning classifiers in refining breast cancer detection and grading. The empirical evidence presented highlights the potential of the CABC algorithm as a trailblazing instrument in this essential area of medical research.