In the context of Industry 4.0, the convergence of the Internet of Things (IoT) and Software Defined Networking (SDN) represents a challenging yet pivotal avenue for bolstering network security. This amalgamation facilitates the establishment of an integrated SDN-IoT platform that adeptly confronts the security intricacies arising from the evolving landscape of interconnected devices and industrial networks. Through the strategic application of SDN, the network architecture undergoes dynamic segmentation, responsive to diverse parameters encompassing device attributes, application contexts, and security imperatives. This segmentation strategy effectively isolates IoT devices, constricting the potential attack surface and correspondingly diminishing the ramifications of security breaches. Therefore, this paper proposed a novel Adaptive Variational Autoencoder-based Modified Archery (AVA-MA) method to enhance the security of IoT devices. In this study, samples are collected and used from both the TON-IoT dataset and the SDN dataset to determine the effectiveness of the proposed AVA-MA method. The evaluation measures such as AUC, F1-score, recall, accuracy, and precision are used to evaluate the performance of the proposed AVA-MA method. The results depict the AVA-MA method attained an accuracy of 98.95 %, precision of 97.54 %, recall of 95.64 %, and F1-score of 98.86 % respectively.