Blog articleMethodology & analyticsComputer science

Data science for cybersecurity: a machine learning overview for doctoral researchers

Machine learning has become central to how security data is analysed, but applying it well means understanding which tasks suit which methods, which benchmark datasets have known limits, and what a credible evaluation looks like. This article sets out the field’s core framework, drawn directly from its most cited overview.

What you will learn

  • Explain how cybersecurity data science relates cybersecurity, data science and machine learning
  • Match supervised, unsupervised and deep learning tasks to specific security problems
  • Name and critique at least two standard benchmark datasets used in intrusion detection research
  • Describe a multi-layered framework for building a data-driven security model
  • Identify open methodological problems a doctoral project could address

What you will unlearn

  • Any classifier trained on security data counts as a contribution to cybersecurity data science.The field, as defined by its core overview, is a process (data collection, preparation, modelling and incremental updating), not a single trained model; a contribution should address a weakness in that process.
  • Benchmark datasets such as KDD’99 are an adequate basis for evaluating a new method on current threats.Older benchmark datasets were built from traffic and attack types that are now outdated, so results on them alone do not establish that a method detects current attacks.
  • Signature-based and anomaly-based detection are competing approaches, and a thesis should pick one.Signature-based detection is reliable for known attacks but misses new ones; anomaly-based detection can flag the unknown but produces more false positives; many systems and most current research combine both.

Skills you will practise

  • Mapping security problems to ML tasks
  • Benchmark dataset evaluation
  • Framework design for data-driven security models
  • Critical reading of applied ML papers
  • Research gap identification in security analytics

What cybersecurity data science is

Cybersecurity aims to protect the confidentiality, integrity and availability of systems and data (the CIA triad) against threats such as unauthorised access, malware, denial-of-service attacks, phishing and previously unseen (zero-day) exploits. As more of this work depends on analysing large volumes of security data, security a data science, in which machine learning is applied to quantify risk, detect anomalous behaviour and support security decisions, has become its own area of study (Sarker et al., 2020).

Sarker et al. (2020) define the field as a process rather than a fixed set of algorithms: it spans collecting security data, preparing it, building machine learning models from it, and updating those models as new data and attack types appear. A doctoral project in this area should be located within that process, addressing a specific stage, rather than treating "apply a classifier to security data" as a complete contribution.

This matters because a model evaluated once, on one dataset, says little about how it will perform once deployed, when attacker behaviour and network conditions have moved on from the data it was trained on. Framing a project around one named stage of the process, such as how features are engineered from raw traffic, or how a model is updated incrementally as new labelled examples arrive, gives a clearer, more defensible scope than a general claim to have "applied machine learning to cybersecurity".

  1. 1Security data collection (network traffic, host logs, or both)
  2. 2Data preparation (cleaning, normalisation, feature extraction)
  3. 3Machine learning modelling (feature engineering, clustering, classification, rule generation)
  4. 4Incremental learning and updating (keeping the model current as data and attacks change)
Figure 1. A four-stage framework for building a data-driven security model, after Sarker et al. (2020).

Matching machine learning tasks to security problems

Different security problems suit different kinds of learning task. Supervised learning, using methods such as naive Bayes, decision trees, k-nearest neighbours and support vector machines, is used for classification tasks such as labelling traffic as an attack or benign, and for regression tasks such as estimating risk scores; it requires labelled examples of both normal and attack behaviour (Sarker et al., 2020). Unsupervised learning, such as k-means or hierarchical clustering, groups behaviour without labels and is used to detect anomalies that do not match any known attack signature. Deep learning methods (multilayer perceptrons, convolutional networks, and recurrent or long short-term memory networks) tend to perform better with large volumes of data, but need more computation and are harder to interpret (Sarker et al., 2020; Xin et al., 2018).

Xin et al. (2018) reviewed how these families of methods have been applied across intrusion detection, malware analysis and spam and phishing detection, and noted that no single family dominates across all tasks: the right choice depends on whether labelled data are available, how much data there is, and whether an analyst needs to understand why a decision was made, which matters for triage and for legal or audit requirements.

A related, often conflated distinction is between signature-based and anomaly-based detection, which cuts across the machine learning task types above. Signature-based systems match observed behaviour against known attack patterns and are reliable for attacks that have been seen before, but cannot detect a genuinely new attack. Anomaly-based systems, typically built on the unsupervised or statistical methods described above, flag behaviour that deviates from a learned notion of normal activity, which can catch unknown attacks but tends to raise more false positives. Most current systems, and most recent research, combine the two rather than treating them as rival approaches (Sarker et al., 2020).

Matching machine learning task types to cybersecurity problems, after Sarker et al. (2020) and Xin et al. (2018)
Task typeExample methodsTypical useMain limitation
Supervised classificationNaive Bayes, decision trees, k-NN, SVMLabelling traffic or events as attack or benignNeeds representative labelled data for both classes
Unsupervised clusteringk-means, hierarchical clusteringFlagging anomalous behaviour with no known signatureHigher false-positive rates; harder to validate without labels
Deep learningMLP, CNN, RNN/LSTMLarge-scale traffic or malware feature dataNeeds more data and compute; less interpretable

Benchmark datasets and their limits

Research in this area is usually evaluated on a small set of benchmark datasets, which makes it important to understand their origin and age. Moustafa and Slay (2015) built UNSW-NB15 from traffic generated in a controlled testbed, including both normal activity and nine attack categories, specifically to address the ageing and unrealistic traffic patterns of older datasets such as KDD’99. Sharafaldin et al. (2018) later built the CIC-IDS2018 dataset using a similar testbed approach with updated attack types and traffic generation profiles, for the same reason: earlier datasets no longer represent current network and attack behaviour.

A dissertation that evaluates a new method only on an older benchmark, without discussing whether that benchmark still represents current attacks, invites a straightforward examiner question. Momand et al. (2023) reviewed recent intrusion detection research and found that studies still mix old and new benchmark datasets inconsistently, which makes it difficult to compare reported results across papers; stating clearly which dataset, which attack categories and which pre-processing steps were used is therefore part of a credible method section.

It is also worth distinguishing a dataset’s size from its realism. A large dataset generated in a single, controlled testbed can still under-represent the diversity of real network traffic, encrypted protocols or the behaviour of a genuinely novel attack family. Where possible, a thesis should state this limitation explicitly rather than let a high reported accuracy on one benchmark stand in for a general claim about detection performance in deployment.

Open methodological problems

Beyond dataset age, Sarker et al. (2020) and Momand et al. (2023) both point to recurring, addressable problems: class imbalance (attack events are far rarer than normal traffic, which biases naive accuracy figures); concept drift (attacker behaviour changes over time, so a model trained once degrades); the volume of alerts a detector generates, which needs correlation and prioritisation to be useful to an analyst; and the difficulty of combining signature-based detection (reliable for known attacks) with anomaly-based detection (needed for unknown ones) without an unmanageable false-positive rate.

Guntoro (2024) reached a similar conclusion in a narrower review of machine learning algorithms for intrusion detection, noting that reported accuracy figures vary widely between studies partly because of inconsistent handling of class imbalance, and recommending that future comparative work report precision, recall and a measure such as the F1 score for the minority (attack) class specifically, not only overall accuracy.

Interpretability is a further open problem, particularly for deep learning models. An analyst deciding whether to act on an alert, or a security team justifying a decision after an incident, needs some account of why a model flagged a given event, not only a score. Xin et al. (2018) noted that this trade-off between the detection power of deep models and the transparency of simpler ones is unresolved, and a thesis that proposes a deep learning detector could usefully address it directly, for example by reporting a feature-attribution method alongside the detector’s predictions and checking whether the attributions make sense to a security analyst.

Worked example (illustrative)

A hypothetical doctoral project addresses class imbalance directly: it trains a gradient-boosted classifier on UNSW-NB15 (Moustafa & Slay, 2015), compares standard training against a version using class-weighted loss and a version using synthetic minority oversampling, and reports precision, recall and F1 for each attack category separately, following the reporting practice Guntoro (2024) recommends. The discussion addresses whether gains on UNSW-NB15 also appear on CIC-IDS2018 (Sharafaldin et al., 2018), as a basic check against overfitting to one benchmark’s particular traffic generation method.

Common mistakes

  • Reporting only overall accuracy on an imbalanced security dataset, which can look high even when the minority (attack) class is detected poorly.
  • Evaluating a new method on one benchmark dataset only, without checking whether results transfer to another.
  • Treating signature-based and anomaly-based detection as mutually exclusive choices rather than complementary techniques.
  • Citing a dataset’s popularity as evidence of its continued relevance, rather than checking when it was built and what attack types it represents.

Key takeaways

  • Cybersecurity data science is a process, from data collection to incremental model updating, not a single trained classifier (Sarker et al., 2020).
  • Supervised, unsupervised and deep learning methods suit different security tasks; no one family dominates across all of them (Sarker et al., 2020; Xin et al., 2018).
  • Standard benchmark datasets such as UNSW-NB15 and CIC-IDS2018 were built specifically to address the ageing of earlier datasets (Moustafa & Slay, 2015; Sharafaldin et al., 2018).
  • Class imbalance, concept drift and alert volume are recurring, addressable research problems in this field (Sarker et al., 2020; Momand et al., 2023).
  • A credible evaluation reports precision, recall and F1 for the attack class specifically, and checks results across more than one benchmark (Guntoro, 2024).
Your next step

Want to apply this to your own study?

  1. 1Tell us your topic, data and deadline
  2. 2A statistician reviews your work with you
  3. 3You get a plan and a quote
Big data analytics

References

  1. Guntoro, G. (2024). Review of machine learning algorithm for intrusion detection system. ComniTech: Journal of Computational Intelligence and Informatics, 1(1), 26-37. https://journal.unilak.ac.id/index.php/ComniTech/article/view/21352
  2. Momand, A., Jan, S. U., & Ramzan, N. (2023). A systematic and comprehensive survey of recent advances in intrusion detection systems using machine learning: Deep learning, datasets, and attack taxonomy. Journal of Sensors, 2023, Article 6048087. https://doi.org/10.1155/2023/6048087
  3. Moustafa, N., & Slay, J. (2015). UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). In 2015 Military Communications and Information Systems Conference (MilCIS) (pp. 1-6). IEEE. https://doi.org/10.1109/MilCIS.2015.7348942
  4. Sarker, I. H., Kayes, A. S. M., Badsha, S., Alqahtani, H., Watters, P., & Ng, A. (2020). Cybersecurity data science: An overview from machine learning perspective. Journal of Big Data, 7(1), Article 41. https://doi.org/10.1186/s40537-020-00318-5
  5. Sharafaldin, I., Lashkari, A. H., & Ghorbani, A. A. (2018). Toward generating a new intrusion detection dataset and intrusion traffic characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP 2018), Vol. 1 (pp. 108-116). https://doi.org/10.5220/0006639801080116
  6. Xin, Y., Kong, L., Liu, Z., Chen, Y., Li, Y., Zhu, H., Gao, M., Hou, H., & Wang, C. (2018). Machine learning and deep learning methods for cybersecurity. IEEE Access, 6, 35365-35381. https://doi.org/10.1109/ACCESS.2018.2836950

How to cite this article

Choose your referencing style, then copy. Check your university's or journal's guide for local variations.

PhD Research Lab Academy. (2022, December 8). Data science for cybersecurity: a machine learning overview for doctoral researchers. PhD Research Lab. https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning/

PhD Research Lab Academy. “Data Science for Cybersecurity: A Machine Learning Overview for Doctoral Researchers.” PhD Research Lab, 8 Dec. 2022, www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning. Accessed [access date].

PhD Research Lab Academy (2022) Data science for cybersecurity: a machine learning overview for doctoral researchers. PhD Research Lab. Available at: https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning/ (Accessed: [access date]).

PhD Research Lab Academy. “Data Science for Cybersecurity: A Machine Learning Overview for Doctoral Researchers.” PhD Research Lab. December 8, 2022. https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning.

PhD Research Lab Academy, ‘Data Science for Cybersecurity: A Machine Learning Overview for Doctoral Researchers’ (PhD Research Lab, 8 December 2022) <https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning> accessed [access date].

PhD Research Lab Academy. Data science for cybersecurity: a machine learning overview for doctoral researchers [Internet]. PhD Research Lab; 2022 Dec 8 [cited [access date]]. Available from: https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning/

PhD Research Lab Academy, “Data science for cybersecurity: a machine learning overview for doctoral researchers,” PhD Research Lab, Dec. 8, 2022. [Online]. Available: https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning. [Accessed: [access date]].

@online{an_overview_of_data_science_for_cybersecurity_from_the_perspective_of_machine_learning_2022,
  author = {{PhD Research Lab Academy}},
  title = {{Data science for cybersecurity: a machine learning overview for doctoral researchers}},
  organization = {PhD Research Lab},
  date = {2022-12-08},
  url = {https://www.phdassistance.com/blog/an-overview-of-data-science-for-cybersecurity-from-the-perspective-of-machine-learning},
  urldate = {[access date]}
}

This article is for learning. Use it to understand the method and cite the original sources above in your own work; do not copy or submit it as your own.

Data science for cybersecurityNeed help applying it to your study?
Big data analytics