In this study, we address the challenge of imbalanced data in credit card fraud detection by proposing a novel approach that leverages Convolutional Neural Networks (CNNs) and undersampling techniques. The imbalance in the dataset, typical of real-world financial transactions, often leads to biased models favoring the majority class. To mitigate this, we employ undersampling to balance the classes, thereby enhancing the CNN's ability to learn from minority instances crucial for fraud detection. Our method is validated on a large unbalanced credit card dataset, demonstrating significant improvements in accuracy compared to traditional CNN models trained on imbalanced data. We evaluate our approach using standard performance metrics, including precision, recall, and F1-score, showcasing its effectiveness in accurately identifying fraudulent transactions while minimizing false positives. Furthermore, we pro-vide insights into the CNN's decision-making process through visualization techniques, shedding light on its ability to discern fraudulent patterns within the data. Our findings highlight the importance of addressing class imbalance in fraud detection tasks and underscore the efficacy of undersampling in enhancing the performance of deep learning models, particularly CNNs, in handling imbalanced datasets.