In this research work, a unique DDoS attack detection and mitigation approach is developed. At first, the input information is carried out into a detection phase, where it identifies the presence of an attack as well as the types of attack. The detection phase will include the “pre-processing, feature extraction, attack detection & attack mitigation.” The collected raw information is pre-processed. Then, the flow-based features such as “flow rate, flow byte, total forward packet, as well as total backward packet” are extracted. In addition, the sequential frequent pattern characteristics are retrieved utilizing the Apriori model. For the precise detection, an ensemble classifier is introduced by inclosing the “Neural Network (ANN), Bi-GRU, Recurrent Neural Network (RNN), and optimized Convolutional Neural Network (CNN).” The DBN, Bi-GRU, and RNN of ensemble classifiers are trained with the retrieved characteristics. The result from DBN, Bi-GRU, and RNN is subjected as an input to an optimized CNN, in which weights of CNN are optimally tuned by a novel hybrid optimization. Then, the Trust_BAIT strategy is used in the mitigation phase to remove the intruder from the network.