Software-Defined Networking (SDN) is a contemporary network strategy utilized instead of a traditional network structure. It provides significantly more administrative efficiency and ease than traditional networks. However, the centralized control used in SDN entails an elevated risk of single-point failure that is more susceptible to different kinds of network assaults like Distributed Denial of Service (DDoS), DoS, spoofing, and API exploitation which are very complex to identify and mitigate. Thus, a powerful intrusion detection system (IDS) based on deep learning is created in this study for the detection and mitigation of network intrusions. This system contains several stages and begins with the data augmentation method named Deep Convolutional Generative Adversarial Networks (DCGAN) to over the data imbalance problem. Then, the features are extracted from the input data using a CenterNet-based approach. After extracting effective characteristics, ResNet152V2 with Slime Mold Algorithm (SMA) based deep learning is implemented to categorize the assaults in InSDN and Edge IIoT datasets. Once the network intrusion is detected, the proposed defense module is activated to restore regular network connectivity quickly. Finally, several experiments are carried out to validate the algorithm's robustness, and the outcomes reveal that the proposed system can successfully detect and mitigate network intrusions.