Breast cancer remains a significant global health concern, necessitating effective early detection and prevention strategies. Despite the effectiveness of mammography in early breast cancer detection, challenges persist due to issues such as Low image quality, limitations of traditional segmentation methods, and suboptimal feature extraction techniques. This paper proposes a novel framework for detecting and classifying breast cancer from mammogram images based on a multilevel semantic segmentation approach that integrates GoogleNet and Multi Dilated Convolutions, hence named as GN-MDC. Apart from this, it is also expected that the improvement in segmentation accuracy with complicated anatomies like pectoral muscles will be enhanced according to the optimized feature selection attained by the WCO algorithm for classification performance. This integration enables the proposed model to accurately classify breast cancer as normal, benign, or malignant. The proposed framework provides better outcomes regarding accuracy, sensitivity, specificity, precision, false negative rate (FNR), f-measure and area under the curve (AUC). This work achieved (99.40 %, 99.53 %), (99.65 %, 99.80 %), (99.08 %, 99.22 %), (99.24 %, 99.32 %), (0.34 %, 0.24 %), (99.44 %, 99.56 %) and (99.37 %, 99.51 %) of accuracy, sensitivity, specificity, precision, FNR, f-measure and AUC on (collected, DDSM datasets) respectively. This study addresses significant challenges in breast cancer identification, presenting a robust solution leveraging advanced deep-learning techniques. The proposed Op-CNN framework contributes toward the overcoming of limits set by the existing methodologies by promising higher sensitivity and specificity with accuracy. Extensive experiments are conducted to prove the efficiency of the approach; it shows great potential in the domain of breast cancer detection and diagnosis.