{"id":10924,"date":"2024-03-18T08:04:35","date_gmt":"2024-03-18T12:04:35","guid":{"rendered":"https:\/\/blogs.mathworks.com\/student-lounge\/?p=10924"},"modified":"2025-06-29T21:57:25","modified_gmt":"2025-06-30T01:57:25","slug":"building-an-intrusion-detection-system-a-triumph-at-the-sanren-cyber-security-challenge","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/student-lounge\/2024\/03\/18\/building-an-intrusion-detection-system-a-triumph-at-the-sanren-cyber-security-challenge\/","title":{"rendered":"Building an Intrusion Detection System: A Triumph at the SANReN Cyber Security Challenge"},"content":{"rendered":"<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Meet the champions: Shani Nezar, Uhone Teffo, Carlo Barnardo, and Heinrich E. Guided, this team trained the most accurate machine learning model among all 10 teams at <a href=\"https:\/\/www.csc.ac.za\/\" target=\"_blank\" rel=\"noopener\">the SANReN Cyber Security Challenge<\/a>! They exploited the ease-to-use capabilities of the MathWorks platform and trained machine learning models via MATLAB Classification Learner App for cyber threat detection. Their proficiency was significantly enhanced by complimentary courses like <a href=\"https:\/\/matlabacademy.mathworks.com\/details\/matlab-onramp\/gettingstarted\">MATLAB Onramp<\/a> and <a href=\"https:\/\/matlabacademy.mathworks.com\/details\/machine-learning-onramp\/machinelearning\">Machine Learning Onramp<\/a>, which equipped them with the latest knowledge in AI swiftly and helped them earn extra points for the competition. Let&#8217;s hear about their journey:<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 600px; height: 400px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_1.png\" alt=\"1705330461559.jpg\" width=\"600\" height=\"400\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Inspiration<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In the dynamic realm of cybersecurity, staying one step ahead of potential threats is paramount. The SANReN Cyber Security Challenge provided a platform for teams to showcase their prowess. Our journey through the challenge was marked by a standout achievement in the MATLAB Classification Challenge: a remarkable 98% accuracy score on a machine learning model designed for intrusion detection. The crux of our success lay in the utilization of the open dataset UNSW-NB15, a goldmine of real-time network traffic data with rich features specifically curated for anomaly-based intrusion detection. The data set can be download at <a href=\"https:\/\/research.unsw.edu.au\/projects\/unsw-nb15-dataset\">the following link<\/a>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Breaking Down the Problem<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The UNSW-NB15 dataset, with its meticulous labelling of attacks (1) and non-attacks (0), served as the foundation for our solution. The primary goal was to leverage the features within the dataset to predict whether a given data point belongs to the attack or non-attack category. This, essentially, was the task at hand \u2013 developing a robust Intrusion Detection System (IDS) capable of discerning malicious activities from normal network behavior.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">How Did We Implement It?<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 668px; height: 135px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_2.png\" alt=\"grapgh.png\" width=\"668\" height=\"135\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Dataset Exploration<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Before diving into the development of the machine learning model, we meticulously explored the UNSW-NB15 dataset. Understanding the intricacies of the features, the distribution of data, and the characteristics of attacks proved crucial in designing an effective solution.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 768px; height: 402px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_3.png\" alt=\"pic1.png\" width=\"768\" height=\"402\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Model Selection<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Given the nature of the problem, we opted for a machine learning approach. Our model of choice was carefully selected based on its suitability for intrusion detection tasks. After thorough evaluation, we settled on a model that showcased promising results during initial experimentation.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Online Trainings with MATLAB Onramp and Machine Learning Onramp<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Our journey to success is significantly enriched by the invaluable skills and insights gained through <a href=\"https:\/\/matlabacademy.mathworks.com\/details\/matlab-onramp\/gettingstarted\">MATLAB Onramp<\/a> and <a href=\"https:\/\/matlabacademy.mathworks.com\/details\/machine-learning-onramp\/machinelearning\">Machine Learning Onramp<\/a> in honing our skills. <a href=\"https:\/\/matlabacademy.mathworks.com\/\">MATLAB&#8217;s Self-paced Online Training<\/a> equipped our team with essential knowledge, allowing us to navigate the intricacies of data exploration and model development seamlessly. These onramps acted as catalysts in our problem-solving journey, bridging the gap between theoretical understanding and practical application.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Low-code AI with MATLAB<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">MATLAB&#8217;s intuitive environment facilitated a smooth exploration of the dataset. With its user-friendly interface and powerful functionalities, we delved into the data, gaining insights that shaped our approach. MATLAB&#8217;s capabilities not only simplified the process but also enhanced our efficiency in handling complex data structures. A noteworthy aspect of our methodology was the utilization of <a href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2022\/08\/25\/lets-talk-about-low-code-ai\/\">low-code AI with MATLAB<\/a>. Leveraging an App coupled with a concise 10 lines of code, we navigated what might have seemed like a daunting coding challenge. This approach not only streamlined our implementation but also highlighted the accessibility of AI, even for those not deeply versed in coding intricacies.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Ready-to-Train Models in Classification Learner App<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The <a href=\"https:\/\/uk.mathworks.com\/help\/stats\/classificationlearner-app.html\">Classification Learner App<\/a> emerged as a game-changer, providing us with ready-to-train models that significantly expedited our development process. This feature allowed us to focus on the application of AI rather than its intricate development especially with having the correct model hyperparameters. The availability of pre-built models within the app played a pivotal role in achieving success without the need for extensive AI expertise.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 768px; height: 402px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_4.png\" alt=\"pic2.png\" width=\"768\" height=\"402\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Results<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The culmination of our efforts resulted in an impressive 95.8% accuracy score. Our machine learning model successfully identified and classified attacks with remarkable precision, showcasing the potential of data-driven approaches in cybersecurity. The ability to predict malicious activities with such accuracy reflects not only the efficiency of our chosen model but also the robustness of our methodology.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 631px; height: 228px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_5.png\" alt=\"pic3.png\" width=\"631\" height=\"228\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 664px; height: 262px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_6.png\" alt=\"pic4.png\" width=\"664\" height=\"262\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Key Takeaways<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">1. Dataset Understanding is Key<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Thoroughly understanding the dataset is foundational. MATLAB enables easy features exploration, pattern identification, and a comprehension of the nature of attacks. Such ease in exploring data greatly influenced the success of the intrusion detection system.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">2. Model Selection Matters<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Selecting the optimal machine learning model for intrusion detection is crucial. MATLAB offers a variety of pre-built models, enabling users to concentrate on enhancing the precision required to detect nuanced irregularities in network traffic, which directly influences the system&#8217;s efficiency.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">3. Real-world Simulation<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The inclusion of fresh, unlabelled data for prediction mirrors the challenges faced in real-world cybersecurity. A model&#8217;s ability to adapt and identify novel threats is a testament to its practicality.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">4. Continuous Improvement<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The landscape of cybersecurity is ever-evolving. Regular updates to the model and continuous monitoring ensure that the IDS remains effective in identifying new and emerging threats.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In conclusion, our success at the SANReN Cyber Security Challenge stands as a testament to the power of machine learning in bolstering cybersecurity defences. The journey from dataset exploration to model deployment underscored the importance of meticulous planning, adaptability, and a deep understanding of the intricacies of network traffic. As we celebrate our triumph, we also acknowledge the ongoing commitment required to stay at the forefront of cybersecurity innovation. The path to a secure digital landscape is paved with continuous learning, resilience, and a proactive approach to emerging threats.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<\/div>\n<p><script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2024\/03\/24Mar18_1.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>\nMeet the champions: Shani Nezar, Uhone Teffo, Carlo Barnardo, and Heinrich E. Guided, this team trained the most accurate machine learning model among all 10 teams at the SANReN Cyber Security&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2024\/03\/18\/building-an-intrusion-detection-system-a-triumph-at-the-sanren-cyber-security-challenge\/\">read more >><\/a><\/p>\n","protected":false},"author":183,"featured_media":10903,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[451,6,13],"tags":[285,703],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10924"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/users\/183"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/comments?post=10924"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10924\/revisions"}],"predecessor-version":[{"id":11031,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10924\/revisions\/11031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media\/10903"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media?parent=10924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/categories?post=10924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/tags?post=10924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}