A rising number of edge devices, like controllers, sensors, and robots, are crucial for Industrial Internet of Things (IIoT) networks for collecting data for communication, storage, and processing. The security of the IIoT could be compromised by any malicious or unusual behavior on the part of any of these devices. They may also make it possible for malicious software placed on end nodes to enter the network and perform unauthorized activities. Existing anomaly detection techniques are less effective due to the increasing diversity of the network and the complexity of cyberattacks. In addition, most strategies are ineffective for devices with limited resources. Therefore, this work presents an effective deep learning based Malware Detection framework to make the edge based IIoT network more secure. This multi-stage system begins with the Deep Convolutional Generative Adversarial Networks (DCGAN) based data augmentation method to overcome the issue of data imbalance. Next, a ConvNeXt-based method extracts the features from the input data. Finally, an optimized Enhanced Elman Spike Neural Network (EESNN) based deep learning is utilized for malware recognition and classification. Using two distinct datasets— MaleVis and Malimg— the generalizability of the suggested model is clearly demonstrated. With an accuracy of 99.24% for MaleVis and 99.31% for the Malimg dataset, the suggested strategy demonstrated excellent results and surpassed all other existing methods. It illustrates how the suggested strategy outperforms alternative models and offers numerous benefits.