Globally, cancer remains a major health challenge due to its high mortality rates. Traditional experimental approaches and therapies are resource-intensive and often cause significant side effects. Anticancer peptides (ACPs) have emerged as alternative therapeutic agents owing to their selectivity, safety, and potential to mitigate drug resistance. In this paper, we propose pACPs-DNN, a novel attention mechanism-based deep learning model developed for the accurate prediction of ACPs and non-ACPs. The pACPs-DNN model transforms input peptides into image representations using residue-wise energy contact matrix (RECM), substitution Matrix Representation (SMR), and Position Specific Scoring Matrix (PSSM) embeddings, followed by local binary pattern (LBP)-based decomposition to capture enhanced structural and local semantic features. These transformations generate novel feature sets, including RECM_LBP, LBP_SMR, and LBP_PSSM. Subsequently, a two-tier feature selection approach is employed to identify a high-ranking optimal feature set, which is then used to train an attention-based deep neural network. The proposed pACPs-DNN model achieves an impressive training accuracy of 96.91 % and an AUC of 0.98. To evaluate its generalization capability, the model was validated on independent datasets, demonstrating significant improvements of 5 % and 3.5 % in accuracy over existing models on the Ind-I and Ind-II datasets, respectively. The demonstrated efficacy and robustness of pACPs-DNN highlight its potential as a valuable tool for advancing drug discovery and academic research in cancer-related therapeutic development.