Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Hybrid ML Intrusion Detection Network IoT #5: Hybrid: Autoencoder (Anomaly) + XGBoost (Attack Classification)”.
Other ways we can help with Python.
Learn with a mentor
Scheduled Cyber Security courses with live guidance and a certificate.

IoT Network Intrusion Detection Course with Hybrid Autoencoder + XGBoost

Cyber Security Course: Foundations of System & Network Security

Ethical Hacking Course: Web Application Penetration Testing
Have it built for you
No time to learn Python? Our team can do the project for you.
See all in Cyber Security →Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Here is the final result, a hybrid system combining XGBoost and autoencoder. The detection rate increases from 66 to 87%, and detected Zero-Di attacks increase from 37 to 80%. Let's get started. Hello, welcome to episode five of the IoT network intrusion detection series with hybrid machine learning. XG,Boost is great at recognizing attacks it has seen before and rarely gives false alarms, while autoencoder can detect new attacks. Today, we are combining both into a two-layer system, an architecture widely used in modern I-DS research.
Create a file named hybrid.py We load the XGBoost and autoencoder models from the previous episode, then calculate the predicted class of XGBoost and the anomaly score for each test connection. We also mark Zero-Di attacks, which are test connections whose attack types were never present in the training data. The hybrid function works in two layers. If XGBoost labels an attack, that category is used. If XGBoost labels normal but the autoencoder error exceeds the threshold, the connection is labeled as a new anomaly. Then we compare four configurations. Run XGBoost alone detects 65.6% of attacks and only 37% of Zero-Di attacks. Autoencoder alone detects 81.6%. Hybrid with a 95th percentile threshold detects 86.7% of attacks and 80% of Zero-Di attacks, with the highest accuracy of 0.879. With a 99th percentile, false alarms drop to 7.8% but detection drops to 75%.
Continue with the graph We shift the threshold from the 50th percentile to 99.9% to plot the detection rate curve against false alarm rate, as well as the detection diagram per category. Let's look at the graph. The hybrid curve is always above the autoencoder alone, meaning, for the same false alarm rate, hybrid always detects more attacks, and the XGBoost star is below both curves. The right diagram shows the largest jump in U2R and R2L, categories that contain the most new attacks. The threshold selection is an operational decision, a hospital network might choose high detection, while a busy data center might choose low false alarm rate.
Done. We have built a hybrid system of autoencoder and XGBoost, analyzed the trade-off between detection and false alarm, and proved its superiority against zero-day attacks. In the final episode, we will evaluate it comprehensively and create a monitoring dashboard. Currently working on a thesis, dissertation, or research in the field of network security and machine learning? Cerdas Inovasi Digital helps implement intrusion detection systems from network traffic preprocessing, feature selection, Random Forest and XGBoost, up to autoencoder for Zero Day attacks and monitoring dashboard, as well as opening Python programming courses for electrical engineering and computer science. Want to master the entire series? From intrusion datasets to hybrid systems ready for monitoring? All six episodes, complete with step-by-step PDF guides, dataset, and source code, are available for premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or one-time payment of Rp999.000 for lifetime access. Want just one class? Buy the single class with lifetime access. Subscribe now on the premium page cerdasinovasidigital.com. Contact our WhatsApp, or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →