updated the readme file
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Cyberattack Detection ML Approach
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: pink
|
| 6 |
sdk: streamlit
|
|
@@ -11,4 +11,78 @@ license: mit
|
|
| 11 |
short_description: UNSW Dataset in an ML-based analysis
|
| 12 |
---
|
| 13 |
|
| 14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Cyberattack Detection ML Approach
|
| 3 |
+
emoji: 🛡️
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: pink
|
| 6 |
sdk: streamlit
|
|
|
|
| 11 |
short_description: UNSW Dataset in an ML-based analysis
|
| 12 |
---
|
| 13 |
|
| 14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 15 |
+
|
| 16 |
+
# Cyber Attack Detection ML Approach
|
| 17 |
+
|
| 18 |
+
This Streamlit app provides an interactive analysis of the UNSW-NB15 dataset, a popular benchmark for evaluating network intrusion detection systems. The app leverages machine learning techniques to classify network traffic as either normal or indicative of various attack types.
|
| 19 |
+
|
| 20 |
+
## About the UNSW-NB15 Dataset
|
| 21 |
+
|
| 22 |
+
The UNSW-NB15 dataset was created by the Cyber Security Lab at the University of New South Wales, Canberra. It's a comprehensive dataset containing network traffic captures (tcpdump) and system call traces. The dataset includes a variety of modern attack types, making it a valuable resource for training and testing intrusion detection systems. Key features of the dataset include:
|
| 23 |
+
|
| 24 |
+
- **Diverse Attack Types:** Covers a wide range of attacks such as Fuzzers, Backdoor, DoS, Exploits, Generic, Reconnaissance, Shellcode, and Worms.
|
| 25 |
+
- **Realistic Network Traffic:** Generated using a realistic network environment, simulating real-world scenarios.
|
| 26 |
+
- **Labeled Data:** Each network flow is labeled with its corresponding attack type or as normal traffic, enabling supervised learning.
|
| 27 |
+
|
| 28 |
+
## App Purpose
|
| 29 |
+
|
| 30 |
+
This app aims to:
|
| 31 |
+
|
| 32 |
+
1. **Visualize and Explore the Data:** Provide an interface to view the dataset's structure, data types, and descriptive statistics. This allows users to understand the characteristics of the UNSW-NB15 dataset.
|
| 33 |
+
2. **Train and Evaluate Machine Learning Models:** Implement and compare the performance of several machine learning classifiers, specifically:
|
| 34 |
+
- Naive Bayes
|
| 35 |
+
- Decision Tree
|
| 36 |
+
- K-Nearest Neighbors
|
| 37 |
+
3. **Analyze Model Performance:** Present confusion matrices and classification reports to evaluate the effectiveness of each model in detecting different attack types. This helps users understand the strengths and weaknesses of each algorithm.
|
| 38 |
+
4. **Facilitate Learning:** Serve as an educational tool for learning about network intrusion detection, machine learning classification, and dataset analysis.
|
| 39 |
+
|
| 40 |
+
## Installation
|
| 41 |
+
|
| 42 |
+
To run this app, you need to have Python installed along with the following libraries:
|
| 43 |
+
|
| 44 |
+
- streamlit
|
| 45 |
+
- datasets
|
| 46 |
+
- pandas
|
| 47 |
+
- huggingface_hub
|
| 48 |
+
- scikit-learn
|
| 49 |
+
- seaborn
|
| 50 |
+
- matplotlib
|
| 51 |
+
- numpy
|
| 52 |
+
- Pillow
|
| 53 |
+
|
| 54 |
+
You can install the required libraries using pip:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install streamlit datasets pandas huggingface_hub scikit-learn seaborn matplotlib numpy Pillow
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Usage
|
| 61 |
+
|
| 62 |
+
1. Ensure you have set the `HF_TOKEN` environment variable with your Hugging Face token.
|
| 63 |
+
2. Run the Streamlit app:
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
streamlit run app.py
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## Features
|
| 70 |
+
|
| 71 |
+
- **Dataset Information:** View the dataset's structure, data types, and descriptive statistics.
|
| 72 |
+
- **Naive Bayes Classifier:** Train and evaluate a Naive Bayes model.
|
| 73 |
+
- **Decision Tree Classifier:** Train and evaluate a Decision Tree model.
|
| 74 |
+
- **K-Nearest Neighbor Classifier:** Train and evaluate a K-Nearest Neighbor model.
|
| 75 |
+
- **Confusion Matrix and Classification Report:** Visualize the performance of each model.
|
| 76 |
+
|
| 77 |
+
## Screenshots
|
| 78 |
+
|
| 79 |
+
!Cybersecurity
|
| 80 |
+
|
| 81 |
+
## License
|
| 82 |
+
|
| 83 |
+
This project is licensed under the MIT License.
|
| 84 |
+
|
| 85 |
+
## Acknowledgements
|
| 86 |
+
|
| 87 |
+
- The UNSW-NB15 dataset creators at the University of New South Wales, Canberra.
|
| 88 |
+
- The Hugging Face team for providing the datasets and tools.
|
app.py
CHANGED
|
@@ -27,7 +27,7 @@ if not hf_token:
|
|
| 27 |
# Login to Hugging Face Hub
|
| 28 |
login(token=hf_token)
|
| 29 |
|
| 30 |
-
st.title("Cyber Attack Detection ML Approach")
|
| 31 |
st.write("This app loads and analyzes the UNSW_NB15_training-set.csv dataset.")
|
| 32 |
|
| 33 |
# Display image
|
|
|
|
| 27 |
# Login to Hugging Face Hub
|
| 28 |
login(token=hf_token)
|
| 29 |
|
| 30 |
+
st.title("🛡️📈 Cyber Attack Detection ML Approach")
|
| 31 |
st.write("This app loads and analyzes the UNSW_NB15_training-set.csv dataset.")
|
| 32 |
|
| 33 |
# Display image
|