Nowadays, the frequency and intensity of cyber attacks have escalated significantly. Traditional network security defenses, which predominantly rely on static, predefined rules to distinguish between legitimate and malicious network traffic, have proven inadequate in identifying complex and sophisticated network intrusions. The integration of artificial intelligence (AI) technologies offers a pathway to enhancing the reliability and effectiveness of these defenses. Convolutional neural networks (CNNs), a subset of deep learning models, have achieved notable advancements in image processing, thereby gaining considerable scholarly attention. By harnessing the capabilities of CNN models, complex network attacks can be efficiently detected through the transformation of network traffic datasets into image representations. This study proposes an intelligent Intrusion Detection System (IDS) model, designed to enhance the security of highway internet-based toll systems, which integrates optimized CNN architectures, transfer learning, and ensemble learning methodologies. The ensemble model is trained on the transformed data and validated using the CICIDS2019 network dataset. The experimental results indicate a detection accuracy of 99.91%, substantiating the feasibility and effectiveness of the proposed approach within this research.