Intrusion detection systems (IDSs) play a critical role in many computer networks to combat attacks from external environments. However, due to the rapid spread of various new attacks, developing a robust IDS that can effectively detect novel attacks and prevent them from devastating network systems is a challenging task. Recently, deep neural networks (DNNs) have been widely used to enhance the accuracy of IDSs in detecting network intrusions. Nevertheless, the performance of DNN highly depends on the representation of the input data. In this paper, we introduce a novel method called DeepInsight-Convolutional Neural Network-Intrusion Detection System (DC-IDS). In CD-IDS, the DeepInsight technique is used to transform the network traffic data into a new representation in the form of an image. This new representation of the traffic data is then used as the input of a Convolutional Neural Network (CNN). We evaluate our proposed technique using an extensive experiment on five IDS datasets. The experimental results show that the proposed model enhances the performance of IDSs in detecting various network attacks compared to different popular machine learning algorithms.