10 Machine Learning Blueprints You Should Know for Cybersecurity 9781804619476

Work on 10 practical projects, each with a blueprint for a different machine learning technique, and apply them in the r

2,515 11 5MB

English Pages 330 Year 2023

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
10 Machine Learning Blueprints You Should Know for Cybersecurity
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
Chapter 1: On Cybersecurity and Machine Learning
The basics of cybersecurity
Traditional principles of cybersecurity
Modern cybersecurity – a multi-faceted issue
Privacy
An overview of machine learning
Machine learning workflow
Supervised learning
Unsupervised learning
Semi-supervised learning
Evaluation metrics
Machine learning – cybersecurity versus other domains
Summary
Chapter 2: Detecting Suspicious Activity
Technical requirements
Basics of anomaly detection
What is anomaly detection?
Introducing the NSL-KDD dataset
Statistical algorithms for intrusion detection
Univariate outlier detection
Elliptic envelope
Local outlier factor
Machine learning algorithms for intrusion detection
Density-based scan (DBSCAN)
One-class SVM
Isolation forest
Autoencoders
Summary
Chapter 3: Malware Detection Using Transformers and BERT
Technical requirements
Basics of malware
What is malware?
Types of malware
Malware detection
Malware detection methods
Malware analysis
Transformers and attention
Understanding attention
Understanding transformers
Understanding BERT
Detecting malware with BERT
Malware as language
The relevance of BERT
Getting the data
Preprocessing the data
Building a classifier
Summary
Chapter 4: Detecting Fake Reviews
Technical requirements
Reviews and integrity
Why fake reviews exist
Evolution of fake reviews
Statistical analysis
Exploratory data analysis
Feature extraction
Statistical tests
Modeling fake reviews with regression
Ordinary Least Squares regression
OLS assumptions
Interpreting OLS regression
Implementing OLS regression
Summary
Chapter 5: Detecting Deepfakes
Technical requirements
All about deepfakes
A foray into GANs
How are deepfakes created?
The social impact of deepfakes
Detecting fake images
A naive model to detect fake images
Detecting deepfake videos
Building deepfake detectors
Summary
Chapter 6: Detecting Machine-Generated Text
Technical requirements
Text generation models
Understanding GPT
Naïve detection
Creating the dataset
Feature exploration
Using machine learning models for detecting text
Playing around with the model
Automatic feature extraction
Transformer methods for detecting automated text
Compare and contrast
Summary
Chapter 7: Attributing Authorship and How to Evade It
Technical requirements
Authorship attribution and obfuscation
What is authorship attribution?
What is authorship obfuscation?
Techniques for authorship attribution
Dataset
Feature extraction
Training the attributor
Improving authorship attribution
Techniques for authorship obfuscation
Improving obfuscation techniques
Summary
Chapter 8: Detecting Fake News with Graph Neural Networks
Technical requirements
An introduction to graphs
What is a graph?
Representing graphs
Graphs in the real world
Machine learning on graphs
Traditional graph learning
Graph embeddings
GNNs
Fake news detection with GNN
Modeling a GNN
The UPFD framework
Dataset and setup
Implementing GNN-based fake news detection
Playing around with the model
Summary
Chapter 9: Attacking Models with Adversarial Machine Learning
Technical requirements
Introduction to AML
The importance of ML
Adversarial attacks
Adversarial tactics
Attacking image models
FGSM
PGD
Attacking text models
Manipulating text
Further attacks
Developing robustness against adversarial attacks
Adversarial training
Defensive distillation
Gradient regularization
Input preprocessing
Ensemble methods
Certified defenses
Summary
Chapter 10: Protecting User Privacy with Differential Privacy
Technical requirements
The basics of privacy
Core elements of data privacy
Privacy and the GDPR
Privacy by design
Privacy and machine learning
Differential privacy
What is differential privacy?
Differential privacy – a real-world example
Benefits of differential privacy
Differentially private machine learning
IBM Diffprivlib
Credit card fraud detection with differential privacy
Differentially private deep learning
DP-SGD algorithm
Implementation
Differential privacy in practice
Summary
Chapter 11: Protecting User Privacy with Federated Machine Learning
Technical requirements
An introduction to federated machine learning
Privacy challenges in machine learning
How federated machine learning works
The benefits of federated learning
Challenges in federated learning
Implementing federated averaging
Importing libraries
Dataset setup
Client setup
Model implementation
Weight scaling
Global model initialization
Setting up the experiment
Putting it all together
Reviewing the privacy-utility trade-off in federated learning
Global model (no privacy)
Local model (full privacy)
Understanding the trade-off
Beyond the MNIST dataset
Summary
Chapter 12: Breaking into the Sec-ML Industry
Study guide for machine learning and cybersecurity
Machine learning theory
Hands-on machine learning
Cybersecurity
Interview questions
Theory-based questions
Experience-based questions
Conceptual questions
Additional project blueprints
Improved intrusion detection
Adversarial attacks on intrusion detection
Hate speech and toxicity detection
Detecting fake news and misinformation
Summary
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
Download a free PDF copy of this book

10 Machine Learning Blueprints You Should Know for Cybersecurity
 9781804619476

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers