This paper proposes a new methodology for improving network security by introducing an optimised hybrid intrusion detection system (IDS) framework solution as a middle layer between the end devices. It considers the difficulty of updating databases to uncover new threats that plague firewalls and detection systems, in addition to big data challenges. The proposed framework introduces a supervised network IDS based on a deep learning technique of convolutional neural networks (CNN) using the UNSW-NB15 dataset. It implements recursive feature elimination (RFE) with extreme gradient boosting (XGB) to reduce resource and time consumption. Additionally, it reduces bias towards the majority class of the dataset by combining the Synthetic Minority Oversampling Technique (SMOTE) with the Bayesian Gaussian Mixture Model (BGMM) to solve the data imbalance problem. The results demonstrate that this model greatly outperforms the existing approaches, attaining identification rates in the binary classification of up to 98.80% and the multiple group classification of up to 96.49%.