Embed presentation
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025DOI: 10.5121/ijcnc.2025.17607 115HYBRID ANOMALY DETECTION MECHANISM FORIOT NETWORKSHarish Kumar Saini, Monika PoriyeDepartment of Computer Science and Applications, Kurukshetra University, IndiaABSTRACTThe Internet of Things (IoT) is the fastest-growing collection of physical entities embedded withtechnologies to sense and exchange information with other connected devices over the Internet.Since IoTsystems are resource-constrained and ad hoc, they are an obvious target for cyberattacks. IoT systemsecurity thus requires continual observation and analysis. The application of machine learning (ML) to IoTsecurity holds particular promise for identifying any anomalies in the system's typical operation. In thispaper, we propose to design a Random Forest-Support Vector Machine (RF-SVM) based Anomalydetection framework for IoT. The RF classifier is applied for selecting the optimal features from theextracted traffic data. It includes removing the outliers, redundant data, and choosing the best featureswith high weight values. Then, SVM is applied for classifying the extracted features and detecting theanomalies. The fitness function is derived in terms of true positives, false positives, and false negatives.From the detected anomalies, the attack type is then determined, and a corresponding warning is sent tothe monitoring nodes.In the experimental results, it is shown that the proposed RF-SVM classifier attainsincreased detection accuracy with reduced detection overhead and packet drops.KEYWORDSIoT, Machine Learning, Ensemble, Anomaly detection1. INTRODUCTIONThe Internet of Things (IoT) is the network of physical devices, such as smartphones, and othersmart objects that exchange information and provide useful services online. The Internet ofThings is a global revolution. It provides the potential for use in a wide range of applicationareas. It has been widely used in retail, agriculture, smart cities, smart homes, smart industries,and environmentmonitoring, among other areas. Connecting devices is the aim of the Internet ofThings. Wireless Sensor Network (WSN) upgrades are very common. WSNs connect IoT devicesto gather environmental data. Due to its limited energy, memory, and processing capabilities, IoTis resource-constrained [1].Due to IoT systems' ad hoc and limited resources, they are an obvious target for cyber-attacks. Asa result, protecting IoT systems requires constant monitoring and analysis. Prior to an attack, it'scritical to know what to do in the event of an unforeseen situation, take precautions, protectimportant data, and assure continuity [2]. During the routing of data packets, data packets arequite likely to be exposed. The data packets would be lost if the rogue node invaded the nodes.Asa result, the security of data packets in IoT-constrained devices has a significant impact because itis linked to the users [3]. For resource-constrained environments, standard security measures areprohibitively expensive. [4]In IoT based sensor network, a Distributed Denial of Service (DDoS) attack is feasible whosemain purpose is to interrupt the data transfer between end users. This exploit generates malicious](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-1-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025116traffic flooding, causing other valid nodes to receive unnecessary packets. Actions of theseattackers contribute to the deterioration of the network in terms of greater bandwidth usage,memory utilization, energy consumption, etc. [5]. Malicious Control, Malicious Operation, andWrong Setup are just some of the additional assaults and abnormalities that might cause an IoTdevice to malfunction [6].An intrusion-detection system (IDS) is a must for any IoT traffic environment that is particularlysensitive. A majority of current research on IDS for the Internet of Things is based on rule-baseddetection. Anomaly-based detection methods are crucial in IoT environments [7] for efficientthreat detection.Any anomalies in the system's behaviour can be detected by using machine learning (ML) for IoTsecurity. An aberrant situation can be detected and protected by a variety of machine learningalgorithms. [6][7].Among the ML algorithms,SVM and RF have been widely used in recent years to suggestfeasible solutions to the IDS problem. SVM can provide good decision surfaces by maximizingmargins using soft-margin approaches. Though SVM is slightly more accurate,it consumes moretime. RF produces similar accuracy in a much faster manner if given modelling parameters.Hence,by combining these two classifiers and creating a hybrid RF-SVM classifier will result inincreased accuracy in less time [11].In this paper, RF-SVM classifier is designed to detect the IoT network traffic anomalies. Incontrast to the existing RF-SVM classifiers, here RF classifier is applied for extracting theoptimal features from the network traffic data and theSVM is applied for classifying the extractedfeatures and detecting the anomalies.This paper is organized as follows. Section 2 presents the related works on anomaly detectionusing ML classifiers and RF-SVM classifiers. Section 3 presents the detailed methodology of theproposed RF-SVM classifier. Section 4 presents the experimental results and Section 5 presentsthe conclusion.2. RELATED WORKS2.1. Anomaly Detection using Machine learning (ML) classifiersIoT attacks and anomalies can be detected using a group of ML classifiers [6]. Decision Tree(DT), Logistic Regression (LR), Support Vector Machine (SVM), Neural Network (ANN). Finalmodels were created using an optimization method based on the training datasets.This system uses a Deep Learning [7] algorithm to identify fraudulent traffic in IoT networks.Network traffic is organised into sessions and anomalous activity is examined. During thetraining phase, the work is done offline and spans a long period of time. When the data is pre-processed, tuples of features are generated and used to train the model. The perceptual learningmodel utilises information gained at each perceptual layer to filter out the preferred traits beforefeeding it to the next perceptual layer.To combat DDoS attacks, a machine-learning framework [8] was developed. The IoT devicetraffic capture mechanism is capable of capturing a wide range of data. Categorizing andretrieving features based on IoT activity has been done and as a final step, a variety of binary](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-2-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025117classification techniques were used to correctly distinguish between normal communication andDoS communications.For low-resource IoT devices, a game theory-based lightweight anomaly detection approach hasbeen proposed [9]. IoT security has been shown as a game between IDS agents and the attackersin this approach. There are new attack patterns that need to be tracked down by the IDS agent.The training, classification, and rule-making phases of the anomaly detection process are allincluded.Using deep migrating learning, a new IoT data feature extraction and IDS has been developed[10]. This document outlines the migration learning model and data feature extraction. Migratingfrom one subject or activity to another is a process of acquiring new knowledge. Research showsthat an IDS model can effectively shorten clustering times while retaining the accuracy requiredto identify intrusions. However, the accuracy of categorisation can suffer throughout thecompression process.2.2. RF-SVM Classifiers for Anomaly DetectionShanmuga sundari et al [12] have shown that fraud detection using RF and SVM techniques maybe compared in terms of accuracy. Using data mining algorithms, they are able to identify bothnormal and fraudulent transactions based on the past information, including exchanges that havebeen misrepresented.Prithi et al [13] have proposed a two-stage hybrid classification technique for intrusion detection.Anomaly detection is done using SVM, while abuse detection is done using (RF)/Decision Tree(DT). In the beginning, the abnormalities are spotted. Second-stage investigation recognises themost common types of DoS and Probe, as well as recognised R2L assaults and User to Root(U2R) assaults.Two categorization models have been developed by Md. Al MehediHasan et al [14]. The SVMand RF model are used for each. Experiments have shown that any classifier works here. SVM isa little more accurate, but it takes a lot longer to run. RF provides the same level of precision in aconsiderably faster manner if the model parameters are provided. These classifiers can helpimprove the accuracy of an IDS system. The KDD'99 Dataset is employed in this study in orderto determine which intrusion detector is more effective on this dataset.In [15], RF-SVM classifier has been applied to classify the gene expression data in ChronicKidney Disease (CKD). Here, RF is highly accurate and is interpretable and SVM effectivelypredicts the gene expression data with very high dimensions.2.2.1. ChallengesDeveloping an effective and efficient anomaly detection model using machine learningalgorithms is a challenging process because of the following reasons[16]:• The classical machine learning algorithms are weak in extracting the best features torepresent the given data.• It’s difficult to deploy a machine learning model over resource-constrained IoT devices.• A huge amount of data is required to train machine learning models to reduce falsepositives and false negatives.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-3-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025118• The processing overhead due to data dimensionality is also an issue in selecting anyanomaly detection mechanism.3. Proposed Solution3.1. OverviewIn this paper, we propose to design RF-SVM-basedAnomaly detection mechanism for IoT. HereRF-SVM classifier module is applied to detect the IoT network traffic anomalies. Although thereare hybrid RF–SVM pipelines, our work is different in three significant ways: A fitness-drivenSVM objective that explicitly optimizes TP, FP, and FN to prioritize anomalous-event recallunder IoT IDS constraints, a gateway-centric RF feature selection with an empirically tunedstability threshold that filters redundant/noisy traffic fields before classification, and adeployment-oriented evaluation in NS-2 with TwoRayGround propagation and workload sweeps(monitoring interval and attack-rate) that reports accuracy as well as detection delay and packetdrop as first-class metrics pertinent to IoT networks. Together, these components represent anovel experimental and methodological contribution that goes beyond the simple statement, "RFfor features, SVM for classification. The RF classifier is applied for selecting the optimal featuresfrom the extracted traffic data. It includes removing the outliers, redundant dataand choosing thebest features with high weight values. Then, SVM is applied for classifying the extracted featuresand detecting the anomalies. The fitness function is derived in terms of true positives, falsepositives and false negatives. From the detected anomalies, the attack type is then determined,and a corresponding warning will be sent to the monitoring nodes.3.2. Decision TreesThe decision tree is a type of supervised learning algorithm that is mostly used in classificationproblems. The simplicity and efficiency are considered the major attributes in the decision treeswhich are very useful in applications where the computational power resources are scarce.The decision trees adopt a top-down approach in splitting the data samples in smaller subsetsbased on different decision criteria, which will be discussed. The root node is considered the bestpredictor. The decision node is the attribute where the highest splitting criterion (information gain,for example) is achieved. At a terminal node or leaf node, the splitting process halts; it representsa decision. In this case, a splitting criterion such as the information gain is equal to zero.A major type of decision tree is an ensemble-based decision tree or Random Forest (RF).3.2.1. Random Forest (RF) AlgorithmRF algorithm is a set of trees and a supervised classification algorithm that generates each treeusing a basic sample of the exclusive training data. In order to classify a new item from an inputtrace, the trace will be positioned beneath each tree in the forest. There is a direct correlationbetween the number of trees in a forest and the potential fallout; that is, the more trees there are,the more accurate the result. Each and every tree offers a vote to indicate the tree's preferenceregarding the item's category. The group that generates the most votes out of all the trees ischosen by the forest. [14][17].There are two stages in the RF algorithm: (i) RF creation, (ii) creating a calculation from thearbitrary forest classifier made in the preliminary phase [17].](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-4-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025119The whole process is shown below:(i) Arbitrary forest formation1. Select "K" aspects at random from the aggregate "M" aspects where K < M.2. Use the finest divided point to assess the node "D" among the "K" aspects.3. Use the best split to split the node into daughter nodes.4. Repeat steps 1 through 3 until "L" nodes are reached.5. Create a forest by repeating steps 1 through 4 "N" times to create "N" trees.(ii) Arbitrary forest estimation1. Uses the test features and each decision tree's rubrics to compute the outcome andstore the anticipated outcome (objective).2. Calculate the number of votes for each anticipated goal.3. Use the highly voted anticipated objective as the arbitrary forest procedure'sclosing expectation.3.2.2. RF-based Feature SelectionRF uses a technique called bootstrap aggregation (Bagging), which samples the data set used inthe classification task, randomly with replacement. The bootstrap method is a resamplingtechnique to generate slightly different data sets from the original training data set, and baggingcombines many classifiers trained with slightly.Let m represent how many instances there are in the real training set. Create a bootstrap model ofdimension m using the real training data. Let m represent the total number of input structuresfound in the real training set. For each tree where k<m, only k features are randomly chosen fromthe bootstrap model data. At each node of the tree, the traits from this group form the bestpossible fragment. The value of m should remain constant throughout the forest's ascent [18].The original Packet Capturing Files (PCAP),which have the network packages were primarilychanged and characterized in a Packet Description Markup Language (PDML) format.The features that reflect the device characteristics and behaviour related to various attacks areonly considered. Each feature has been assigned a weight value. The best subset of features withhigher weight values is selected by RF algorithm.Table 1 :Extracted features and assigned weightsS.No Features Weight value1 Protocol type 12 src (bytes) 23 sest (bytes) 24 Duration 15 Flag 16 Service 37 dst_host_count 38 serv_count 29 serv_error_rate 410 same_serv_rate 311 diff_serv_rate 3](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-5-2048.jpg&f=jpg&w=240)

![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 202512121. Move to the next interval T(i+1)22. End For23. Stop___________________________________________________________According to this algorithm, the optimum features selected by the RF classifier algorithm are:serv_error_rate, Dst_host_serror_rate, No_failed_attempts, No_file_creations, No_access_files,and No_compromized.3.3. SVM ClassifierThe basic principle of SVM is finding the optimal linear hyperplane in the feature space thatmaximally separates the two target classes [16]. Geometrically, the SVM modelling algorithmfinds an optimal hyperplane with the maximal margin to separate two classes,In SVM, the training set is provided as(x1,y1),(x2,y2),….(xn,yn) , xjnR , yj }1,1{ −+ .Here, xj is the input characteristic vector of thejthmodel, and yj is the output catalogue = +1 or -1.SVM splits the +ve and -ve instances by means of a hyperplane asRbRwbxw n=+ ,,0.. (1)Here, w.x signifies the dot product of w & x.SVM calculates the finest hyperplane by exploiting the border.The choice function f(x) = sgn(g(x)) for an event is provided asg(x) = +=liiii bxxy1.. (2)where i is the numerical limit for imminent vector xiFigure 3 Concept of SVM](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-7-2048.jpg&f=jpg&w=240)

![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025123extracted features and the, features having the least fitness values are considered as anomalies.The corresponding device or user is fetched from the PCAP history and blocked from furtheroperations.4. EXPERIMENTAL RESULTS4.1. Dataset and PDMLThe training and testing were performed on the DARPA 2009 IDS dataset. Though the DARPA2009 dataset is old and not specific to IoT, it is still used in some research for baselinebenchmarking and method validation purposes. The dataset is well-structured and the labeledtraffic is publicly available, allowing researchers to compare their results with a large number ofprevious studies that were conducted using the same dataset and its labeled traffic. In doing so,the DARPA 2009 dataset allows researchers to have a common dataset to refer to whenevaluating a new algorithm against the established results from a long-standing body of intrusiondetection research. Additionally, the DARPA 2009 dataset can also serve as a useful avenue fortesting the general detection capacity of models as they are deployed and applied to morecomplex and heterogeneous datasets after testing them first under a controlled and well-established environment.The dataset comprises about 7000 PCAP files. The dataset comprises a variety of security eventsand attack types. PCAP files are data files generated using tools such as Libpcap of Linux. Thesefiles contain packet data of a network and are used to analyze the network characteristics. Theyalsocontribute to controlling the network traffic and determining network status.Wireshark can save network packet dissections in a PDML file. PDML conforms to the XMLstandard and contains details about the packet analysis.4.2. Comparison with Existing TechniquesThe proposed RF-SVM based anomaly detection framework is simulated in NS2 and comparedwith the existing Lightweight Anomaly Detection (LAD) [10] and Deep Migration Learning(DML) based IDS [11]. The performance is evaluated in terms of detection delay, detectionaccuracy, and packet drop. Table 3 shows the experimental parameters used in the simulation.Table 3: Experimental parametersNumber of Nodes 22Simulation area 500 X 500mMAC Protocol IEEE 802.11Traffic type CBR and ExponentialNumber of Wired Nodes 2Number of wireless nodes 20Propagation TwoRayGroundAntenna OmniAntennaSimulation Time 20,40,60,80 and 100 secRate 25,50,75,100 and 125Kb](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-9-2048.jpg&f=jpg&w=240)




![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 20251285. CONCLUSIONIn this paper, we propose to develop a Random Forest-Support Vector Machine (RF-SVM) basedAnomaly detection mechanism for IoT. The RF classifier is applied for selecting the optimalfeatures from the extracted traffic data. It includes removing the outliers, redundant data, andchoosing the best features with high weight values. Then, SVM is applied for classifying theextracted features and detecting the anomalies. The fitness function is derived in terms of truepositives, false positives, and false negatives. From the detected anomalies, the attack type is thendetermined, and a corresponding warning is sent to the monitoring nodes.The proposed RF-SVM attains the highest accuracy, precision, recall, and the F1-score whencompared to these algorithms. The proposed RF-SVM-based anomaly detection framework issimulated in NS2 and compared with the existing LAD and DML-based IDS techniques. Theperformance is evaluated in terms of detection delay, detection accuracy, and packet drop. In theexperimental results, it is shown that the proposed RF-SVM classifier attains increased detectionaccuracy with reduced packet drops.CONFLICTS OF INTERESTThe authors have no competing interests to declare that are relevant to thecontent of this article.There is no conflict of interest.REFERENCES[1] R. Stephen and L. Arockiam, “RIAIDRPL: Rank Increased Attack (RIA) Identification Algorithmfor Avoiding Loop in the RPL DODAG,” Int. J. Pure Appl. Math., vol. 119, no. 16, 2018.[2] F. Y. Yavuz, D. Ünal, and E. Gül, “Deep learning for detection of routing attacks in the Internet ofThings,” Int. J. Comput. Intell. Syst., vol. 12, pp. 39–58, 2018.[3] Z. A. Almusaylim, N. Z. Jhanjhi, and A. Alhumam, “Detection and mitigation of RPL rank andversion number attacks in the Internet of Things: SRPL-RP,” Sensors, vol. 20, 2020.[4] A. Aris, S. F. Oktug, and B. O. Yalcin, “RPL version number attacks: In-depth study,” in Proc.IEEE Conf., 2016.[5] B. A. Alabsi, M. Anbar, S. Manickam, and O. E. Elejla, “DDoS attack aware environment withsecure clustering and routing based on RPL protocol operation,” IET Circuits Devices Syst.,2019.[6] M. Hasan, M. M. Islam, M. I. Islam Zarif, and M. M. A. Hashem, “Attack and anomaly detection inIoT sensors in IoT sites using machine learning approaches,” Internet Things, vol. 7, 2019.[7] G. Thamilarasu and S. Chawla, “Towards deep-learning-driven intrusion detection for the Internetof Things,” Sensors, 2019.[8] R. Doshi, N. Apthorpe, and N. Feamster, “Machine learning DDoS detection for consumer Internetof Things devices,” arXiv:1804.04159v1 [cs.CR], 2018.[9] H. Sedjelmaci, S. M. Senouci, and M. Al-Bahri, “A lightweight anomaly detection technique forlow-resource IoT devices: a game-theoretic methodology,” in IEEE Int. Conf. Commun. (ICC),Mobile and Wireless Networking Symp.,2016.[10] D. Lia, L. Deng, M. Lee, and H. Wang, “IoT data feature extraction and intrusion detection systemfor smart cities based on deep migration learning,” Int. J. Inf. Manag., vol. 49, pp. 533–545, 2019.[11] F. Huang, J. Shen, Q. Guo, and Y. Shi, “eRFSVM: A hybrid classifier to predict enhancers—integrating random forests with support vector machines,” Hereditas, 2016.[12] M. Shanmugasundari and R. K. Nayak, “Master card anomaly detection using random forest andsupport vector machine algorithms,” J. Crit. Rev., vol. 7, no. 9, 2020.[13] S. Prithi and S. Sumathi, “Intrusion detection system using hybrid SVM-RF and SVM-DT inwireless sensor networks,” Int. J. Recent Technol. Eng., vol. 8, no. 2S8, 2019.[14] M. A. M. Hasan, M. Nasser, B. Pal, and S. Ahmad, “Support vector machine and random forestmodelling for intrusion detection system (IDS),” J. Intell. Learn. Syst. Appl., vol. 6, no. 1, Feb.2014.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-14-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025129[15] Z. Rustam, E. Sudarsono, and D. Sarwinda, “Random-Forest (RF) and support vector machine(SVM) implementation for analysis of gene expression data in chronic kidney disease (CKD),”in Proc. 9th Annu. Basic Sci. Int. Conf., 2019.[16] A. Diro et al., “A comprehensive study of anomaly detection schemes in IoT networks usingmachine learning algorithms,” Sensors, vol. 21, no. 24, Art. no. 8320, 2021.[17] Pughazendi N, Valarmathi K, Rajaraman PV, Balaji S. RETRACTED: Reliable cluster based datacollection framework for IoT-big data healthcare applications. Journal of Intelligent & FuzzySystems: Applications in Engineering and Technology. 2023;0(0). doi:10.3233/JIFS-233505.[18] B. Duraisamy, S. Gopalakrishnan, S.-Y. Hsieh, and S.-L. Peng, Intelligent Computing andInnovation on Data Science: Proceedings of ICTIDS 2021. Springer, 2021.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-15-2048.jpg&f=jpg&w=240)
The Internet of Things (IoT) is the fastest-growing collection of physical entities embedded with technologies to sense and exchange information with other connected devices over the Internet.Since IoT systems are resource-constrained and ad hoc, they are an obvious target for cyberattacks. IoT system security thus requires continual observation and analysis. The application of machine learning (ML) to IoT security holds particular promise for identifying any anomalies in the system's typical operation. In this paper, we propose to design a Random Forest-Support Vector Machine (RF-SVM) based Anomaly detection framework for IoT. The RF classifier is applied for selecting the optimal features from the extracted traffic data. It includes removing the outliers, redundant data, and choosing the best features with high weight values. Then, SVM is applied for classifying the extracted features and detecting the anomalies. The fitness function is derived in terms of true positives, false positives, and false negatives. From the detected anomalies, the attack type is then determined, and a corresponding warning is sent to the monitoring nodes.In the experimental results, it is shown that the proposed RF-SVM classifier attains increased detection accuracy with reduced detection overhead and packet drops.
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025DOI: 10.5121/ijcnc.2025.17607 115HYBRID ANOMALY DETECTION MECHANISM FORIOT NETWORKSHarish Kumar Saini, Monika PoriyeDepartment of Computer Science and Applications, Kurukshetra University, IndiaABSTRACTThe Internet of Things (IoT) is the fastest-growing collection of physical entities embedded withtechnologies to sense and exchange information with other connected devices over the Internet.Since IoTsystems are resource-constrained and ad hoc, they are an obvious target for cyberattacks. IoT systemsecurity thus requires continual observation and analysis. The application of machine learning (ML) to IoTsecurity holds particular promise for identifying any anomalies in the system's typical operation. In thispaper, we propose to design a Random Forest-Support Vector Machine (RF-SVM) based Anomalydetection framework for IoT. The RF classifier is applied for selecting the optimal features from theextracted traffic data. It includes removing the outliers, redundant data, and choosing the best featureswith high weight values. Then, SVM is applied for classifying the extracted features and detecting theanomalies. The fitness function is derived in terms of true positives, false positives, and false negatives.From the detected anomalies, the attack type is then determined, and a corresponding warning is sent tothe monitoring nodes.In the experimental results, it is shown that the proposed RF-SVM classifier attainsincreased detection accuracy with reduced detection overhead and packet drops.KEYWORDSIoT, Machine Learning, Ensemble, Anomaly detection1. INTRODUCTIONThe Internet of Things (IoT) is the network of physical devices, such as smartphones, and othersmart objects that exchange information and provide useful services online. The Internet ofThings is a global revolution. It provides the potential for use in a wide range of applicationareas. It has been widely used in retail, agriculture, smart cities, smart homes, smart industries,and environmentmonitoring, among other areas. Connecting devices is the aim of the Internet ofThings. Wireless Sensor Network (WSN) upgrades are very common. WSNs connect IoT devicesto gather environmental data. Due to its limited energy, memory, and processing capabilities, IoTis resource-constrained [1].Due to IoT systems' ad hoc and limited resources, they are an obvious target for cyber-attacks. Asa result, protecting IoT systems requires constant monitoring and analysis. Prior to an attack, it'scritical to know what to do in the event of an unforeseen situation, take precautions, protectimportant data, and assure continuity [2]. During the routing of data packets, data packets arequite likely to be exposed. The data packets would be lost if the rogue node invaded the nodes.Asa result, the security of data packets in IoT-constrained devices has a significant impact because itis linked to the users [3]. For resource-constrained environments, standard security measures areprohibitively expensive. [4]In IoT based sensor network, a Distributed Denial of Service (DDoS) attack is feasible whosemain purpose is to interrupt the data transfer between end users. This exploit generates malicious](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-1-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025116traffic flooding, causing other valid nodes to receive unnecessary packets. Actions of theseattackers contribute to the deterioration of the network in terms of greater bandwidth usage,memory utilization, energy consumption, etc. [5]. Malicious Control, Malicious Operation, andWrong Setup are just some of the additional assaults and abnormalities that might cause an IoTdevice to malfunction [6].An intrusion-detection system (IDS) is a must for any IoT traffic environment that is particularlysensitive. A majority of current research on IDS for the Internet of Things is based on rule-baseddetection. Anomaly-based detection methods are crucial in IoT environments [7] for efficientthreat detection.Any anomalies in the system's behaviour can be detected by using machine learning (ML) for IoTsecurity. An aberrant situation can be detected and protected by a variety of machine learningalgorithms. [6][7].Among the ML algorithms,SVM and RF have been widely used in recent years to suggestfeasible solutions to the IDS problem. SVM can provide good decision surfaces by maximizingmargins using soft-margin approaches. Though SVM is slightly more accurate,it consumes moretime. RF produces similar accuracy in a much faster manner if given modelling parameters.Hence,by combining these two classifiers and creating a hybrid RF-SVM classifier will result inincreased accuracy in less time [11].In this paper, RF-SVM classifier is designed to detect the IoT network traffic anomalies. Incontrast to the existing RF-SVM classifiers, here RF classifier is applied for extracting theoptimal features from the network traffic data and theSVM is applied for classifying the extractedfeatures and detecting the anomalies.This paper is organized as follows. Section 2 presents the related works on anomaly detectionusing ML classifiers and RF-SVM classifiers. Section 3 presents the detailed methodology of theproposed RF-SVM classifier. Section 4 presents the experimental results and Section 5 presentsthe conclusion.2. RELATED WORKS2.1. Anomaly Detection using Machine learning (ML) classifiersIoT attacks and anomalies can be detected using a group of ML classifiers [6]. Decision Tree(DT), Logistic Regression (LR), Support Vector Machine (SVM), Neural Network (ANN). Finalmodels were created using an optimization method based on the training datasets.This system uses a Deep Learning [7] algorithm to identify fraudulent traffic in IoT networks.Network traffic is organised into sessions and anomalous activity is examined. During thetraining phase, the work is done offline and spans a long period of time. When the data is pre-processed, tuples of features are generated and used to train the model. The perceptual learningmodel utilises information gained at each perceptual layer to filter out the preferred traits beforefeeding it to the next perceptual layer.To combat DDoS attacks, a machine-learning framework [8] was developed. The IoT devicetraffic capture mechanism is capable of capturing a wide range of data. Categorizing andretrieving features based on IoT activity has been done and as a final step, a variety of binary](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-2-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025117classification techniques were used to correctly distinguish between normal communication andDoS communications.For low-resource IoT devices, a game theory-based lightweight anomaly detection approach hasbeen proposed [9]. IoT security has been shown as a game between IDS agents and the attackersin this approach. There are new attack patterns that need to be tracked down by the IDS agent.The training, classification, and rule-making phases of the anomaly detection process are allincluded.Using deep migrating learning, a new IoT data feature extraction and IDS has been developed[10]. This document outlines the migration learning model and data feature extraction. Migratingfrom one subject or activity to another is a process of acquiring new knowledge. Research showsthat an IDS model can effectively shorten clustering times while retaining the accuracy requiredto identify intrusions. However, the accuracy of categorisation can suffer throughout thecompression process.2.2. RF-SVM Classifiers for Anomaly DetectionShanmuga sundari et al [12] have shown that fraud detection using RF and SVM techniques maybe compared in terms of accuracy. Using data mining algorithms, they are able to identify bothnormal and fraudulent transactions based on the past information, including exchanges that havebeen misrepresented.Prithi et al [13] have proposed a two-stage hybrid classification technique for intrusion detection.Anomaly detection is done using SVM, while abuse detection is done using (RF)/Decision Tree(DT). In the beginning, the abnormalities are spotted. Second-stage investigation recognises themost common types of DoS and Probe, as well as recognised R2L assaults and User to Root(U2R) assaults.Two categorization models have been developed by Md. Al MehediHasan et al [14]. The SVMand RF model are used for each. Experiments have shown that any classifier works here. SVM isa little more accurate, but it takes a lot longer to run. RF provides the same level of precision in aconsiderably faster manner if the model parameters are provided. These classifiers can helpimprove the accuracy of an IDS system. The KDD'99 Dataset is employed in this study in orderto determine which intrusion detector is more effective on this dataset.In [15], RF-SVM classifier has been applied to classify the gene expression data in ChronicKidney Disease (CKD). Here, RF is highly accurate and is interpretable and SVM effectivelypredicts the gene expression data with very high dimensions.2.2.1. ChallengesDeveloping an effective and efficient anomaly detection model using machine learningalgorithms is a challenging process because of the following reasons[16]:• The classical machine learning algorithms are weak in extracting the best features torepresent the given data.• It’s difficult to deploy a machine learning model over resource-constrained IoT devices.• A huge amount of data is required to train machine learning models to reduce falsepositives and false negatives.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-3-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025118• The processing overhead due to data dimensionality is also an issue in selecting anyanomaly detection mechanism.3. Proposed Solution3.1. OverviewIn this paper, we propose to design RF-SVM-basedAnomaly detection mechanism for IoT. HereRF-SVM classifier module is applied to detect the IoT network traffic anomalies. Although thereare hybrid RF–SVM pipelines, our work is different in three significant ways: A fitness-drivenSVM objective that explicitly optimizes TP, FP, and FN to prioritize anomalous-event recallunder IoT IDS constraints, a gateway-centric RF feature selection with an empirically tunedstability threshold that filters redundant/noisy traffic fields before classification, and adeployment-oriented evaluation in NS-2 with TwoRayGround propagation and workload sweeps(monitoring interval and attack-rate) that reports accuracy as well as detection delay and packetdrop as first-class metrics pertinent to IoT networks. Together, these components represent anovel experimental and methodological contribution that goes beyond the simple statement, "RFfor features, SVM for classification. The RF classifier is applied for selecting the optimal featuresfrom the extracted traffic data. It includes removing the outliers, redundant dataand choosing thebest features with high weight values. Then, SVM is applied for classifying the extracted featuresand detecting the anomalies. The fitness function is derived in terms of true positives, falsepositives and false negatives. From the detected anomalies, the attack type is then determined,and a corresponding warning will be sent to the monitoring nodes.3.2. Decision TreesThe decision tree is a type of supervised learning algorithm that is mostly used in classificationproblems. The simplicity and efficiency are considered the major attributes in the decision treeswhich are very useful in applications where the computational power resources are scarce.The decision trees adopt a top-down approach in splitting the data samples in smaller subsetsbased on different decision criteria, which will be discussed. The root node is considered the bestpredictor. The decision node is the attribute where the highest splitting criterion (information gain,for example) is achieved. At a terminal node or leaf node, the splitting process halts; it representsa decision. In this case, a splitting criterion such as the information gain is equal to zero.A major type of decision tree is an ensemble-based decision tree or Random Forest (RF).3.2.1. Random Forest (RF) AlgorithmRF algorithm is a set of trees and a supervised classification algorithm that generates each treeusing a basic sample of the exclusive training data. In order to classify a new item from an inputtrace, the trace will be positioned beneath each tree in the forest. There is a direct correlationbetween the number of trees in a forest and the potential fallout; that is, the more trees there are,the more accurate the result. Each and every tree offers a vote to indicate the tree's preferenceregarding the item's category. The group that generates the most votes out of all the trees ischosen by the forest. [14][17].There are two stages in the RF algorithm: (i) RF creation, (ii) creating a calculation from thearbitrary forest classifier made in the preliminary phase [17].](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-4-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025119The whole process is shown below:(i) Arbitrary forest formation1. Select "K" aspects at random from the aggregate "M" aspects where K < M.2. Use the finest divided point to assess the node "D" among the "K" aspects.3. Use the best split to split the node into daughter nodes.4. Repeat steps 1 through 3 until "L" nodes are reached.5. Create a forest by repeating steps 1 through 4 "N" times to create "N" trees.(ii) Arbitrary forest estimation1. Uses the test features and each decision tree's rubrics to compute the outcome andstore the anticipated outcome (objective).2. Calculate the number of votes for each anticipated goal.3. Use the highly voted anticipated objective as the arbitrary forest procedure'sclosing expectation.3.2.2. RF-based Feature SelectionRF uses a technique called bootstrap aggregation (Bagging), which samples the data set used inthe classification task, randomly with replacement. The bootstrap method is a resamplingtechnique to generate slightly different data sets from the original training data set, and baggingcombines many classifiers trained with slightly.Let m represent how many instances there are in the real training set. Create a bootstrap model ofdimension m using the real training data. Let m represent the total number of input structuresfound in the real training set. For each tree where k<m, only k features are randomly chosen fromthe bootstrap model data. At each node of the tree, the traits from this group form the bestpossible fragment. The value of m should remain constant throughout the forest's ascent [18].The original Packet Capturing Files (PCAP),which have the network packages were primarilychanged and characterized in a Packet Description Markup Language (PDML) format.The features that reflect the device characteristics and behaviour related to various attacks areonly considered. Each feature has been assigned a weight value. The best subset of features withhigher weight values is selected by RF algorithm.Table 1 :Extracted features and assigned weightsS.No Features Weight value1 Protocol type 12 src (bytes) 23 sest (bytes) 24 Duration 15 Flag 16 Service 37 dst_host_count 38 serv_count 29 serv_error_rate 410 same_serv_rate 311 diff_serv_rate 3](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-5-2048.jpg&f=jpg&w=240)

![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 202512121. Move to the next interval T(i+1)22. End For23. Stop___________________________________________________________According to this algorithm, the optimum features selected by the RF classifier algorithm are:serv_error_rate, Dst_host_serror_rate, No_failed_attempts, No_file_creations, No_access_files,and No_compromized.3.3. SVM ClassifierThe basic principle of SVM is finding the optimal linear hyperplane in the feature space thatmaximally separates the two target classes [16]. Geometrically, the SVM modelling algorithmfinds an optimal hyperplane with the maximal margin to separate two classes,In SVM, the training set is provided as(x1,y1),(x2,y2),….(xn,yn) , xjnR , yj }1,1{ −+ .Here, xj is the input characteristic vector of thejthmodel, and yj is the output catalogue = +1 or -1.SVM splits the +ve and -ve instances by means of a hyperplane asRbRwbxw n=+ ,,0.. (1)Here, w.x signifies the dot product of w & x.SVM calculates the finest hyperplane by exploiting the border.The choice function f(x) = sgn(g(x)) for an event is provided asg(x) = +=liiii bxxy1.. (2)where i is the numerical limit for imminent vector xiFigure 3 Concept of SVM](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-7-2048.jpg&f=jpg&w=240)

![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025123extracted features and the, features having the least fitness values are considered as anomalies.The corresponding device or user is fetched from the PCAP history and blocked from furtheroperations.4. EXPERIMENTAL RESULTS4.1. Dataset and PDMLThe training and testing were performed on the DARPA 2009 IDS dataset. Though the DARPA2009 dataset is old and not specific to IoT, it is still used in some research for baselinebenchmarking and method validation purposes. The dataset is well-structured and the labeledtraffic is publicly available, allowing researchers to compare their results with a large number ofprevious studies that were conducted using the same dataset and its labeled traffic. In doing so,the DARPA 2009 dataset allows researchers to have a common dataset to refer to whenevaluating a new algorithm against the established results from a long-standing body of intrusiondetection research. Additionally, the DARPA 2009 dataset can also serve as a useful avenue fortesting the general detection capacity of models as they are deployed and applied to morecomplex and heterogeneous datasets after testing them first under a controlled and well-established environment.The dataset comprises about 7000 PCAP files. The dataset comprises a variety of security eventsand attack types. PCAP files are data files generated using tools such as Libpcap of Linux. Thesefiles contain packet data of a network and are used to analyze the network characteristics. Theyalsocontribute to controlling the network traffic and determining network status.Wireshark can save network packet dissections in a PDML file. PDML conforms to the XMLstandard and contains details about the packet analysis.4.2. Comparison with Existing TechniquesThe proposed RF-SVM based anomaly detection framework is simulated in NS2 and comparedwith the existing Lightweight Anomaly Detection (LAD) [10] and Deep Migration Learning(DML) based IDS [11]. The performance is evaluated in terms of detection delay, detectionaccuracy, and packet drop. Table 3 shows the experimental parameters used in the simulation.Table 3: Experimental parametersNumber of Nodes 22Simulation area 500 X 500mMAC Protocol IEEE 802.11Traffic type CBR and ExponentialNumber of Wired Nodes 2Number of wireless nodes 20Propagation TwoRayGroundAntenna OmniAntennaSimulation Time 20,40,60,80 and 100 secRate 25,50,75,100 and 125Kb](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-9-2048.jpg&f=jpg&w=240)




![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 20251285. CONCLUSIONIn this paper, we propose to develop a Random Forest-Support Vector Machine (RF-SVM) basedAnomaly detection mechanism for IoT. The RF classifier is applied for selecting the optimalfeatures from the extracted traffic data. It includes removing the outliers, redundant data, andchoosing the best features with high weight values. Then, SVM is applied for classifying theextracted features and detecting the anomalies. The fitness function is derived in terms of truepositives, false positives, and false negatives. From the detected anomalies, the attack type is thendetermined, and a corresponding warning is sent to the monitoring nodes.The proposed RF-SVM attains the highest accuracy, precision, recall, and the F1-score whencompared to these algorithms. The proposed RF-SVM-based anomaly detection framework issimulated in NS2 and compared with the existing LAD and DML-based IDS techniques. Theperformance is evaluated in terms of detection delay, detection accuracy, and packet drop. In theexperimental results, it is shown that the proposed RF-SVM classifier attains increased detectionaccuracy with reduced packet drops.CONFLICTS OF INTERESTThe authors have no competing interests to declare that are relevant to thecontent of this article.There is no conflict of interest.REFERENCES[1] R. Stephen and L. Arockiam, “RIAIDRPL: Rank Increased Attack (RIA) Identification Algorithmfor Avoiding Loop in the RPL DODAG,” Int. J. Pure Appl. Math., vol. 119, no. 16, 2018.[2] F. Y. Yavuz, D. Ünal, and E. Gül, “Deep learning for detection of routing attacks in the Internet ofThings,” Int. J. Comput. Intell. Syst., vol. 12, pp. 39–58, 2018.[3] Z. A. Almusaylim, N. Z. Jhanjhi, and A. Alhumam, “Detection and mitigation of RPL rank andversion number attacks in the Internet of Things: SRPL-RP,” Sensors, vol. 20, 2020.[4] A. Aris, S. F. Oktug, and B. O. Yalcin, “RPL version number attacks: In-depth study,” in Proc.IEEE Conf., 2016.[5] B. A. Alabsi, M. Anbar, S. Manickam, and O. E. Elejla, “DDoS attack aware environment withsecure clustering and routing based on RPL protocol operation,” IET Circuits Devices Syst.,2019.[6] M. Hasan, M. M. Islam, M. I. Islam Zarif, and M. M. A. Hashem, “Attack and anomaly detection inIoT sensors in IoT sites using machine learning approaches,” Internet Things, vol. 7, 2019.[7] G. Thamilarasu and S. Chawla, “Towards deep-learning-driven intrusion detection for the Internetof Things,” Sensors, 2019.[8] R. Doshi, N. Apthorpe, and N. Feamster, “Machine learning DDoS detection for consumer Internetof Things devices,” arXiv:1804.04159v1 [cs.CR], 2018.[9] H. Sedjelmaci, S. M. Senouci, and M. Al-Bahri, “A lightweight anomaly detection technique forlow-resource IoT devices: a game-theoretic methodology,” in IEEE Int. Conf. Commun. (ICC),Mobile and Wireless Networking Symp.,2016.[10] D. Lia, L. Deng, M. Lee, and H. Wang, “IoT data feature extraction and intrusion detection systemfor smart cities based on deep migration learning,” Int. J. Inf. Manag., vol. 49, pp. 533–545, 2019.[11] F. Huang, J. Shen, Q. Guo, and Y. Shi, “eRFSVM: A hybrid classifier to predict enhancers—integrating random forests with support vector machines,” Hereditas, 2016.[12] M. Shanmugasundari and R. K. Nayak, “Master card anomaly detection using random forest andsupport vector machine algorithms,” J. Crit. Rev., vol. 7, no. 9, 2020.[13] S. Prithi and S. Sumathi, “Intrusion detection system using hybrid SVM-RF and SVM-DT inwireless sensor networks,” Int. J. Recent Technol. Eng., vol. 8, no. 2S8, 2019.[14] M. A. M. Hasan, M. Nasser, B. Pal, and S. Ahmad, “Support vector machine and random forestmodelling for intrusion detection system (IDS),” J. Intell. Learn. Syst. Appl., vol. 6, no. 1, Feb.2014.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-14-2048.jpg&f=jpg&w=240)
![International Journal of Computer Networks & Communications (IJCNC) Vol.17, No.6, November 2025129[15] Z. Rustam, E. Sudarsono, and D. Sarwinda, “Random-Forest (RF) and support vector machine(SVM) implementation for analysis of gene expression data in chronic kidney disease (CKD),”in Proc. 9th Annu. Basic Sci. Int. Conf., 2019.[16] A. Diro et al., “A comprehensive study of anomaly detection schemes in IoT networks usingmachine learning algorithms,” Sensors, vol. 21, no. 24, Art. no. 8320, 2021.[17] Pughazendi N, Valarmathi K, Rajaraman PV, Balaji S. RETRACTED: Reliable cluster based datacollection framework for IoT-big data healthcare applications. Journal of Intelligent & FuzzySystems: Applications in Engineering and Technology. 2023;0(0). doi:10.3233/JIFS-233505.[18] B. Duraisamy, S. Gopalakrishnan, S.-Y. Hsieh, and S.-L. Peng, Intelligent Computing andInnovation on Data Science: Proceedings of ICTIDS 2021. Springer, 2021.](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f17625cnc07-251210143656-d64144fa%2f75%2fHybrid-Anomaly-Detection-Mechanism-for-IOT-Networks-15-2048.jpg&f=jpg&w=240)