IoTNetworkMalwareClassifier


NameIoTNetworkMalwareClassifier JSON
Version 0.0.20 PyPI version JSON
download
home_pagehttps://github.com/sergio11/iot_network_malware_classifier
Summary🛡️ The IoT Network Malware Classifier 🚀 is an advanced solution tackling security concerns in IoT, employing deep learning for precise malware detection in network traffic.
upload_time2024-05-04 10:47:57
maintainerNone
docs_urlNone
authorSergio Sánchez Sánchez
requires_python<4,>=3.7
licenseNone
keywords iot malware network traffic deep learning classification
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🛡️ IoT Network Malware Classifier with Deep Learning Neural Network Architecture 🚀

Welcome to the **IoT Network Malware Classifier**, an advanced solution crafted to tackle the evolving security threats within the realm of the Internet of Things (IoT). As the proliferation of interconnected devices continues to surge within IoT networks, the need for robust cybersecurity measures becomes increasingly paramount.

In today's digital landscape, where IoT devices permeate various aspects of our lives, safeguarding these interconnected ecosystems is no longer a choice but a necessity. Malicious actors are constantly devising new methods to exploit vulnerabilities within IoT networks, posing significant risks to data privacy, system integrity, and overall network security.

Built upon cutting-edge Deep Learning Neural Network architecture, this classifier leverages the power of artificial intelligence to analyze and categorize network traffic with unparalleled precision and efficiency. By harnessing the capabilities of machine learning algorithms, this solution adapts to the dynamic nature of malware threats, providing proactive defense mechanisms to mitigate potential risks.

Don't hesitate to review the Jupyter Notebook attached, you could go through the intricate process of training and constructing the machine learning model using the renowned **Keras framework**. From data preprocessing and model design to training and evaluation, each step encapsulates the essence of project's commitment to delivering state-of-the-art cybersecurity solutions for the IoT landscape. 🛡️🔒

<p align="center">
   <img src="https://img.shields.io/badge/pypi-3775A9?style=for-the-badge&logo=pypi&logoColor=white" />
   <img src="https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue" />
   <img src="https://img.shields.io/badge/Keras-FF0000?style=for-the-badge&logo=keras&logoColor=white" />
   <img src="https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge&logo=tensorflow&logoColor=white" />
   <img src="https://img.shields.io/badge/Jupyter-F37626.svg?&style=for-the-badge&logo=Jupyter&logoColor=white" />
   <img src="https://img.shields.io/badge/Pandas-2C2D72?style=for-the-badge&logo=pandas&logoColor=white" />
   <img src="https://img.shields.io/badge/Numpy-777BB4?style=for-the-badge&logo=numpy&logoColor=white" />
</p>

🙏🙏 I would like to extend my gratitude to **Stratosphere Laboratory** for providing the labeled dataset with malicious and benign IoT network traffic. This dataset was created as part of the Avast AIC laboratory with the funding of Avast Software.
> Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746

[![GitHub](https://img.shields.io/badge/GitHub-View%20on%20GitHub-blue?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier)
[![PyPI](https://img.shields.io/pypi/v/IoTNetworkMalwareClassifier.svg?style=flat-square)](https://pypi.org/project/IoTNetworkMalwareClassifier/)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier/blob/main/LICENSE)

## 🌟 Key Features:
- **Precise Classification:** Utilizes Deep Learning models for accurate classification of malware in network traffic data.
- **Efficiency:** Implements optimized algorithms for fast and efficient processing of large volumes of data.
- **Scalability:** Designed to handle large data flows in high-demand IoT environments.
- **Ease of Use:** Offers an intuitive and straightforward interface for seamless integration and use across different applications and platforms.

With the **IoT Network Malware Classifier**, organizations can bolster their cybersecurity posture by identifying and mitigating malware threats in their IoT networks proactively and effectively. 🌐🔒

## Installation 🚀

You can easily install VehicleDetectionTracker using pip:

```bash
pip install IoTNetworkMalwareClassifier
```

### How IoT Network Malware Classifier Works 🛠️

The **IoT Network Malware Classifier** employs a multi-step process to preprocess the data before training the neural network model:

1. **Data Cleaning** 🧹:
   - Features with a high percentage of missing values are discarded to ensure data integrity and prevent biased model training.
   - High-cardinality features that do not contribute significantly to generalized prediction are also removed to streamline the preprocessing pipeline.

2. **Data Encoding and Scaling** 📊:
   - Categorical features are encoded using techniques like label encoding to convert them into numerical representations suitable for model training.
   - Numerical features are scaled to a common range using techniques like standardization to ensure uniformity and improve convergence during model training.

3. **Neural Network Architecture** 🧠:
   - The classifier utilizes a deep neural network architecture comprising input, hidden, and output layers.
   - **Input Layer**: Accommodates the preprocessed features of the network traffic data.
   - **Hidden Layers**: Multiple dense layers with activation functions (e.g., ReLU) and dropout regularization capture intricate data patterns while preventing overfitting.
   - **Output Layer**: Produces probabilities for different malware classes using a softmax activation function, facilitating multi-class classification.

4. **Dropout Regularization** 🚫:
   - Dropout layers are strategically incorporated after each batch normalization layer in the model architecture.
   - **Dropout**: Randomly deactivates a fraction of neurons during training iterations, preventing overfitting and promoting the generalization capability of the model.

5. **Model Compilation** 📋:
   - The model is compiled with the Adam optimizer, categorical cross-entropy loss function, and evaluation metrics including accuracy and precision.
   - **Benefits**: The incorporation of dropout regularization aids in preventing overfitting and enhancing the generalization performance of the model on unseen data.

By leveraging these preprocessing techniques and a carefully designed neural network architecture, the **IoT Network Malware Classifier** achieves precise and efficient malware classification, contributing to enhanced cybersecurity in IoT environments. 🛡️🔒

## Example to make predictions on IoT-related network data

The code demonstrates how to utilize the `MalwareClassifier` class to make predictions on IoT-related network data. Here's a breakdown of the steps:

- **Importing the classifier**: The `MalwareClassifier` class is imported from the `classifier` module within the `IoTNetworkMalwareClassifier` package.
- **Example data**: Example data is defined as a list of dictionaries. Each dictionary represents a network data record, with various features such as IP addresses, ports, protocols, etc.
- **Performing predictions**: A prediction is made using the `predict()` method of the classifier. This method takes the input data and returns a list of dictionaries containing the predicted labels and scores for each prediction.
- **Printing results**: The prediction results are printed to the console.

```python

# Create an instance of the IoT Network Malware Classifier
from IoTNetworkMalwareClassifier.classifier import MalwareClassifier

classifier = MalwareClassifier()

# Example data
data = [{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 37120,
    'id.resp_h': '102.165.48.81',
    'id.resp_p': 17769,
    'proto': 'tcp',
    'conn_state': 'RSTR',
    'history': 'ShAdfDr',
    'orig_pkts': 10,
    'orig_ip_bytes': 1572,
    'resp_pkts': 8,
    'resp_ip_bytes': 540
},
{
    'id.orig_h': '192.168.1.1',
    'id.orig_p': 47805,
    'id.resp_h': '192.168.1.195',
    'id.resp_p': 22,
    'proto': 'tcp',
    'conn_state': 'SF',
    'history': 'DdAaFf',
    'orig_pkts': 400,
    'orig_ip_bytes': 26336,
    'resp_pkts': 268,
    'resp_ip_bytes': 36368
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 123,
    'id.resp_h': '82.113.53.40',
    'id.resp_p': 123,
    'proto': 'udp',
    'conn_state': 'S0',
    'history': 'D',
    'orig_pkts': 1,
    'orig_ip_bytes': 76,
    'resp_pkts': 0,
    'resp_ip_bytes': 0
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 37122,
    'id.resp_h': '102.165.48.81',
    'id.resp_p': 17769,
    'proto': 'tcp',
    'conn_state': 'RSTR',
    'history': 'ShAdfDr',
    'orig_pkts': 10,
    'orig_ip_bytes': 1572,
    'resp_pkts': 8,
    'resp_ip_bytes': 540
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 123,
    'id.resp_h': '212.111.30.190',
    'id.resp_p': 123,
    'proto': 'udp',
    'conn_state': 'SF',
    'history': 'Dd',
    'orig_pkts': 2,
    'orig_ip_bytes': 152,
    'resp_pkts': 2,
    'resp_ip_bytes': 152
}]

# Perform prediction
predictions = classifier.predict(data)
print(predictions)
```

The prediction results are presented in the form of a list of dictionaries. Each dictionary contains the predicted label and associated scores for each class. Here's a detailed explanation of the fields in each results dictionary:

- **`result`**: The predicted label for the corresponding data record.
- **`scores`**: A dictionary containing the scores for each class. The keys are the class labels, and the values are the scores associated with those classes.

The scores represent the probability of the data record belonging to each class. The higher the score, the greater the classifier's confidence in the prediction for that class. Each score is formatted as a decimal number with a precision of 10 decimals.

For example, in the first data record, it is predicted to be "Malicious C&C" with a score of 0.7948055267, indicating high confidence in the prediction.

This results format facilitates understanding of the predictions made by the malware classifier and allows for decision-making based on confidence in those predictions. 🧠

```
[
    {
        'result': 'Malicious   C&C',
        'scores': {
            'Benign': '0.1896078140',
            'Malicious': '0.0008148123',
            'Malicious   C&C': '0.7948055267',
            'Malicious   DDoS': '0.0147715705',
            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'
        }
    },
    {
        'result': 'Malicious   DDoS',
        'scores': {
            'Benign': '0.3036604226',
            'Malicious': '0.1889142990',
            'Malicious   C&C': '0.0181397330',
            'Malicious   DDoS': '0.4892515838',
            'Malicious   PartOfAHorizontalPortScan': '0.0000339999'
        }
    },
    {
        'result': 'Benign',
        'scores': {
            'Benign': '0.9999802113',
            'Malicious': '0.0000042536',
            'Malicious   C&C': '0.0000123474',
            'Malicious   DDoS': '0.0000030778',
            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'
        }
    },
    {
        'result': 'Malicious   C&C',
        'scores': {
            'Benign': '0.1895969808',
            'Malicious': '0.0008148027',
            'Malicious   C&C': '0.7948169112',
            'Malicious   DDoS': '0.0147710536',
            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'
        }
    },
    {
        'result': 'Benign',
        'scores': {
            'Benign': '0.9999989271',
            'Malicious': '0.0000000269',
            'Malicious   C&C': '0.0000009888',
            'Malicious   DDoS': '0.0000001118',
            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'
        }
    }
]
```

## License 📜

This project is licensed under the MIT License - see the [LICENSE](https://github.com/sergio11/iot_network_malware_classifier/blob/main/LICENSE) file for details.

## Acknowledgments:
I extend my sincere gratitude to the **Stratosphere Laboratory** for providing the labeled dataset with malicious and benign IoT network traffic. This dataset has served as a crucial starting point for developing the machine learning model. The dataset includes labels that explain the linkages between flows connected with harmful or possibly malicious activity, providing invaluable insights for network malware researchers and analysts. Special thanks to Agustin Parmisano, Sebastian Garcia, and Maria Jose Erquiaga for their contributions to the dataset, made available on January 22th, and for their ongoing efforts to advance cybersecurity research.

The dataset used in this project is available [here](https://www.kaggle.com/datasets/agungpambudi/network-malware-detection-connection-analysis) and can also be found on the [Stratosphere Laboratory website](https://www.stratosphereips.org/datasets-iot23).

> Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746

## Contribution

Contributions to IoTNetworkMalwareClassifier are highly encouraged! If you're interested in adding new features, resolving bugs, or enhancing the project's functionality, please feel free to submit pull requests.

## Get in Touch 📬

IoTNetworkMalwareClassifier is developed and maintained by **Sergio Sánchez Sánchez** (Dream Software). Special thanks to the open-source community and the contributors who have made this project possible. If you have any questions, feedback, or suggestions, feel free to reach out at  [dreamsoftware92@gmail.com](mailto:dreamsoftware92@gmail.com).

## ¡Happy coding! 🚀

[![GitHub](https://img.shields.io/badge/GitHub-View%20on%20GitHub-blue?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier)
[![PyPI](https://img.shields.io/pypi/v/IoTNetworkMalwareClassifier.svg?style=flat-square)](https://pypi.org/project/IoTNetworkMalwareClassifier/)

## Visitors Count

<img width="auto" src="https://profile-counter.glitch.me/iot_network_malware_classifier/count.svg" />

## Please Share & Star the repository to keep me motivated.
  <a href = "https://github.com/sergio11/iot_network_malware_classifier/stargazers">
     <img src = "https://img.shields.io/github/stars/sergio11/iot_network_malware_classifier" />
  </a>


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sergio11/iot_network_malware_classifier",
    "name": "IoTNetworkMalwareClassifier",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.7",
    "maintainer_email": null,
    "keywords": "IoT, malware, network traffic, Deep Learning, classification",
    "author": "Sergio S\u00e1nchez S\u00e1nchez",
    "author_email": "dreamsoftware92@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f0/e3/214a14d630c9de9fba8b19d02aef51cf244075cfb99b0853458929689437/iotnetworkmalwareclassifier-0.0.20.tar.gz",
    "platform": null,
    "description": "# \ud83d\udee1\ufe0f IoT Network Malware Classifier with Deep Learning Neural Network Architecture \ud83d\ude80\r\n\r\nWelcome to the **IoT Network Malware Classifier**, an advanced solution crafted to tackle the evolving security threats within the realm of the Internet of Things (IoT). As the proliferation of interconnected devices continues to surge within IoT networks, the need for robust cybersecurity measures becomes increasingly paramount.\r\n\r\nIn today's digital landscape, where IoT devices permeate various aspects of our lives, safeguarding these interconnected ecosystems is no longer a choice but a necessity. Malicious actors are constantly devising new methods to exploit vulnerabilities within IoT networks, posing significant risks to data privacy, system integrity, and overall network security.\r\n\r\nBuilt upon cutting-edge Deep Learning Neural Network architecture, this classifier leverages the power of artificial intelligence to analyze and categorize network traffic with unparalleled precision and efficiency. By harnessing the capabilities of machine learning algorithms, this solution adapts to the dynamic nature of malware threats, providing proactive defense mechanisms to mitigate potential risks.\r\n\r\nDon't hesitate to review the Jupyter Notebook attached, you could go through the intricate process of training and constructing the machine learning model using the renowned **Keras framework**. From data preprocessing and model design to training and evaluation, each step encapsulates the essence of project's commitment to delivering state-of-the-art cybersecurity solutions for the IoT landscape. \ud83d\udee1\ufe0f\ud83d\udd12\r\n\r\n<p align=\"center\">\r\n   <img src=\"https://img.shields.io/badge/pypi-3775A9?style=for-the-badge&logo=pypi&logoColor=white\" />\r\n   <img src=\"https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue\" />\r\n   <img src=\"https://img.shields.io/badge/Keras-FF0000?style=for-the-badge&logo=keras&logoColor=white\" />\r\n   <img src=\"https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge&logo=tensorflow&logoColor=white\" />\r\n   <img src=\"https://img.shields.io/badge/Jupyter-F37626.svg?&style=for-the-badge&logo=Jupyter&logoColor=white\" />\r\n   <img src=\"https://img.shields.io/badge/Pandas-2C2D72?style=for-the-badge&logo=pandas&logoColor=white\" />\r\n   <img src=\"https://img.shields.io/badge/Numpy-777BB4?style=for-the-badge&logo=numpy&logoColor=white\" />\r\n</p>\r\n\r\n\ud83d\ude4f\ud83d\ude4f I would like to extend my gratitude to **Stratosphere Laboratory** for providing the labeled dataset with malicious and benign IoT network traffic. This dataset was created as part of the Avast AIC laboratory with the funding of Avast Software.\r\n> Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746\r\n\r\n[![GitHub](https://img.shields.io/badge/GitHub-View%20on%20GitHub-blue?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier)\r\n[![PyPI](https://img.shields.io/pypi/v/IoTNetworkMalwareClassifier.svg?style=flat-square)](https://pypi.org/project/IoTNetworkMalwareClassifier/)\r\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier/blob/main/LICENSE)\r\n\r\n## \ud83c\udf1f Key Features:\r\n- **Precise Classification:** Utilizes Deep Learning models for accurate classification of malware in network traffic data.\r\n- **Efficiency:** Implements optimized algorithms for fast and efficient processing of large volumes of data.\r\n- **Scalability:** Designed to handle large data flows in high-demand IoT environments.\r\n- **Ease of Use:** Offers an intuitive and straightforward interface for seamless integration and use across different applications and platforms.\r\n\r\nWith the **IoT Network Malware Classifier**, organizations can bolster their cybersecurity posture by identifying and mitigating malware threats in their IoT networks proactively and effectively. \ud83c\udf10\ud83d\udd12\r\n\r\n## Installation \ud83d\ude80\r\n\r\nYou can easily install VehicleDetectionTracker using pip:\r\n\r\n```bash\r\npip install IoTNetworkMalwareClassifier\r\n```\r\n\r\n### How IoT Network Malware Classifier Works \ud83d\udee0\ufe0f\r\n\r\nThe **IoT Network Malware Classifier** employs a multi-step process to preprocess the data before training the neural network model:\r\n\r\n1. **Data Cleaning** \ud83e\uddf9:\r\n   - Features with a high percentage of missing values are discarded to ensure data integrity and prevent biased model training.\r\n   - High-cardinality features that do not contribute significantly to generalized prediction are also removed to streamline the preprocessing pipeline.\r\n\r\n2. **Data Encoding and Scaling** \ud83d\udcca:\r\n   - Categorical features are encoded using techniques like label encoding to convert them into numerical representations suitable for model training.\r\n   - Numerical features are scaled to a common range using techniques like standardization to ensure uniformity and improve convergence during model training.\r\n\r\n3. **Neural Network Architecture** \ud83e\udde0:\r\n   - The classifier utilizes a deep neural network architecture comprising input, hidden, and output layers.\r\n   - **Input Layer**: Accommodates the preprocessed features of the network traffic data.\r\n   - **Hidden Layers**: Multiple dense layers with activation functions (e.g., ReLU) and dropout regularization capture intricate data patterns while preventing overfitting.\r\n   - **Output Layer**: Produces probabilities for different malware classes using a softmax activation function, facilitating multi-class classification.\r\n\r\n4. **Dropout Regularization** \ud83d\udeab:\r\n   - Dropout layers are strategically incorporated after each batch normalization layer in the model architecture.\r\n   - **Dropout**: Randomly deactivates a fraction of neurons during training iterations, preventing overfitting and promoting the generalization capability of the model.\r\n\r\n5. **Model Compilation** \ud83d\udccb:\r\n   - The model is compiled with the Adam optimizer, categorical cross-entropy loss function, and evaluation metrics including accuracy and precision.\r\n   - **Benefits**: The incorporation of dropout regularization aids in preventing overfitting and enhancing the generalization performance of the model on unseen data.\r\n\r\nBy leveraging these preprocessing techniques and a carefully designed neural network architecture, the **IoT Network Malware Classifier** achieves precise and efficient malware classification, contributing to enhanced cybersecurity in IoT environments. \ud83d\udee1\ufe0f\ud83d\udd12\r\n\r\n## Example to make predictions on IoT-related network data\r\n\r\nThe code demonstrates how to utilize the `MalwareClassifier` class to make predictions on IoT-related network data. Here's a breakdown of the steps:\r\n\r\n- **Importing the classifier**: The `MalwareClassifier` class is imported from the `classifier` module within the `IoTNetworkMalwareClassifier` package.\r\n- **Example data**: Example data is defined as a list of dictionaries. Each dictionary represents a network data record, with various features such as IP addresses, ports, protocols, etc.\r\n- **Performing predictions**: A prediction is made using the `predict()` method of the classifier. This method takes the input data and returns a list of dictionaries containing the predicted labels and scores for each prediction.\r\n- **Printing results**: The prediction results are printed to the console.\r\n\r\n```python\r\n\r\n# Create an instance of the IoT Network Malware Classifier\r\nfrom IoTNetworkMalwareClassifier.classifier import MalwareClassifier\r\n\r\nclassifier = MalwareClassifier()\r\n\r\n# Example data\r\ndata = [{\r\n    'id.orig_h': '192.168.1.195',\r\n    'id.orig_p': 37120,\r\n    'id.resp_h': '102.165.48.81',\r\n    'id.resp_p': 17769,\r\n    'proto': 'tcp',\r\n    'conn_state': 'RSTR',\r\n    'history': 'ShAdfDr',\r\n    'orig_pkts': 10,\r\n    'orig_ip_bytes': 1572,\r\n    'resp_pkts': 8,\r\n    'resp_ip_bytes': 540\r\n},\r\n{\r\n    'id.orig_h': '192.168.1.1',\r\n    'id.orig_p': 47805,\r\n    'id.resp_h': '192.168.1.195',\r\n    'id.resp_p': 22,\r\n    'proto': 'tcp',\r\n    'conn_state': 'SF',\r\n    'history': 'DdAaFf',\r\n    'orig_pkts': 400,\r\n    'orig_ip_bytes': 26336,\r\n    'resp_pkts': 268,\r\n    'resp_ip_bytes': 36368\r\n},\r\n{\r\n    'id.orig_h': '192.168.1.195',\r\n    'id.orig_p': 123,\r\n    'id.resp_h': '82.113.53.40',\r\n    'id.resp_p': 123,\r\n    'proto': 'udp',\r\n    'conn_state': 'S0',\r\n    'history': 'D',\r\n    'orig_pkts': 1,\r\n    'orig_ip_bytes': 76,\r\n    'resp_pkts': 0,\r\n    'resp_ip_bytes': 0\r\n},\r\n{\r\n    'id.orig_h': '192.168.1.195',\r\n    'id.orig_p': 37122,\r\n    'id.resp_h': '102.165.48.81',\r\n    'id.resp_p': 17769,\r\n    'proto': 'tcp',\r\n    'conn_state': 'RSTR',\r\n    'history': 'ShAdfDr',\r\n    'orig_pkts': 10,\r\n    'orig_ip_bytes': 1572,\r\n    'resp_pkts': 8,\r\n    'resp_ip_bytes': 540\r\n},\r\n{\r\n    'id.orig_h': '192.168.1.195',\r\n    'id.orig_p': 123,\r\n    'id.resp_h': '212.111.30.190',\r\n    'id.resp_p': 123,\r\n    'proto': 'udp',\r\n    'conn_state': 'SF',\r\n    'history': 'Dd',\r\n    'orig_pkts': 2,\r\n    'orig_ip_bytes': 152,\r\n    'resp_pkts': 2,\r\n    'resp_ip_bytes': 152\r\n}]\r\n\r\n# Perform prediction\r\npredictions = classifier.predict(data)\r\nprint(predictions)\r\n```\r\n\r\nThe prediction results are presented in the form of a list of dictionaries. Each dictionary contains the predicted label and associated scores for each class. Here's a detailed explanation of the fields in each results dictionary:\r\n\r\n- **`result`**: The predicted label for the corresponding data record.\r\n- **`scores`**: A dictionary containing the scores for each class. The keys are the class labels, and the values are the scores associated with those classes.\r\n\r\nThe scores represent the probability of the data record belonging to each class. The higher the score, the greater the classifier's confidence in the prediction for that class. Each score is formatted as a decimal number with a precision of 10 decimals.\r\n\r\nFor example, in the first data record, it is predicted to be \"Malicious C&C\" with a score of 0.7948055267, indicating high confidence in the prediction.\r\n\r\nThis results format facilitates understanding of the predictions made by the malware classifier and allows for decision-making based on confidence in those predictions. \ud83e\udde0\r\n\r\n```\r\n[\r\n    {\r\n        'result': 'Malicious   C&C',\r\n        'scores': {\r\n            'Benign': '0.1896078140',\r\n            'Malicious': '0.0008148123',\r\n            'Malicious   C&C': '0.7948055267',\r\n            'Malicious   DDoS': '0.0147715705',\r\n            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'\r\n        }\r\n    },\r\n    {\r\n        'result': 'Malicious   DDoS',\r\n        'scores': {\r\n            'Benign': '0.3036604226',\r\n            'Malicious': '0.1889142990',\r\n            'Malicious   C&C': '0.0181397330',\r\n            'Malicious   DDoS': '0.4892515838',\r\n            'Malicious   PartOfAHorizontalPortScan': '0.0000339999'\r\n        }\r\n    },\r\n    {\r\n        'result': 'Benign',\r\n        'scores': {\r\n            'Benign': '0.9999802113',\r\n            'Malicious': '0.0000042536',\r\n            'Malicious   C&C': '0.0000123474',\r\n            'Malicious   DDoS': '0.0000030778',\r\n            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'\r\n        }\r\n    },\r\n    {\r\n        'result': 'Malicious   C&C',\r\n        'scores': {\r\n            'Benign': '0.1895969808',\r\n            'Malicious': '0.0008148027',\r\n            'Malicious   C&C': '0.7948169112',\r\n            'Malicious   DDoS': '0.0147710536',\r\n            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'\r\n        }\r\n    },\r\n    {\r\n        'result': 'Benign',\r\n        'scores': {\r\n            'Benign': '0.9999989271',\r\n            'Malicious': '0.0000000269',\r\n            'Malicious   C&C': '0.0000009888',\r\n            'Malicious   DDoS': '0.0000001118',\r\n            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'\r\n        }\r\n    }\r\n]\r\n```\r\n\r\n## License \ud83d\udcdc\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/sergio11/iot_network_malware_classifier/blob/main/LICENSE) file for details.\r\n\r\n## Acknowledgments:\r\nI extend my sincere gratitude to the **Stratosphere Laboratory** for providing the labeled dataset with malicious and benign IoT network traffic. This dataset has served as a crucial starting point for developing the machine learning model. The dataset includes labels that explain the linkages between flows connected with harmful or possibly malicious activity, providing invaluable insights for network malware researchers and analysts. Special thanks to Agustin Parmisano, Sebastian Garcia, and Maria Jose Erquiaga for their contributions to the dataset, made available on January 22th, and for their ongoing efforts to advance cybersecurity research.\r\n\r\nThe dataset used in this project is available [here](https://www.kaggle.com/datasets/agungpambudi/network-malware-detection-connection-analysis) and can also be found on the [Stratosphere Laboratory website](https://www.stratosphereips.org/datasets-iot23).\r\n\r\n> Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746\r\n\r\n## Contribution\r\n\r\nContributions to IoTNetworkMalwareClassifier are highly encouraged! If you're interested in adding new features, resolving bugs, or enhancing the project's functionality, please feel free to submit pull requests.\r\n\r\n## Get in Touch \ud83d\udcec\r\n\r\nIoTNetworkMalwareClassifier is developed and maintained by **Sergio S\u00e1nchez S\u00e1nchez** (Dream Software). Special thanks to the open-source community and the contributors who have made this project possible. If you have any questions, feedback, or suggestions, feel free to reach out at  [dreamsoftware92@gmail.com](mailto:dreamsoftware92@gmail.com).\r\n\r\n## \u00a1Happy coding! \ud83d\ude80\r\n\r\n[![GitHub](https://img.shields.io/badge/GitHub-View%20on%20GitHub-blue?style=flat-square)](https://github.com/sergio11/iot_network_malware_classifier)\r\n[![PyPI](https://img.shields.io/pypi/v/IoTNetworkMalwareClassifier.svg?style=flat-square)](https://pypi.org/project/IoTNetworkMalwareClassifier/)\r\n\r\n## Visitors Count\r\n\r\n<img width=\"auto\" src=\"https://profile-counter.glitch.me/iot_network_malware_classifier/count.svg\" />\r\n\r\n## Please Share & Star the repository to keep me motivated.\r\n  <a href = \"https://github.com/sergio11/iot_network_malware_classifier/stargazers\">\r\n     <img src = \"https://img.shields.io/github/stars/sergio11/iot_network_malware_classifier\" />\r\n  </a>\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "\ud83d\udee1\ufe0f The IoT Network Malware Classifier \ud83d\ude80 is an advanced solution tackling security concerns in IoT, employing deep learning for precise malware detection in network traffic.",
    "version": "0.0.20",
    "project_urls": {
        "Homepage": "https://github.com/sergio11/iot_network_malware_classifier"
    },
    "split_keywords": [
        "iot",
        " malware",
        " network traffic",
        " deep learning",
        " classification"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a69bd45e835064e2eee6f7fedab5416aed0fa96ff1785dc4d4df5349a184589",
                "md5": "b72059ea7dd74b334758f050d4cbfce3",
                "sha256": "0c9e8fc2c7756d18780df2dc189af956d8a5f19ef2d902048db23cd4e6abcbbd"
            },
            "downloads": -1,
            "filename": "IoTNetworkMalwareClassifier-0.0.20-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b72059ea7dd74b334758f050d4cbfce3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 2238151,
            "upload_time": "2024-05-04T10:47:54",
            "upload_time_iso_8601": "2024-05-04T10:47:54.814228Z",
            "url": "https://files.pythonhosted.org/packages/4a/69/bd45e835064e2eee6f7fedab5416aed0fa96ff1785dc4d4df5349a184589/IoTNetworkMalwareClassifier-0.0.20-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0e3214a14d630c9de9fba8b19d02aef51cf244075cfb99b0853458929689437",
                "md5": "00edf8a02426ea9d491e1b6e5f28a181",
                "sha256": "8f054a4f3010d81925d1a24907920a3690d692ad1316ee5052c5a2667659c7b4"
            },
            "downloads": -1,
            "filename": "iotnetworkmalwareclassifier-0.0.20.tar.gz",
            "has_sig": false,
            "md5_digest": "00edf8a02426ea9d491e1b6e5f28a181",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 2232907,
            "upload_time": "2024-05-04T10:47:57",
            "upload_time_iso_8601": "2024-05-04T10:47:57.299644Z",
            "url": "https://files.pythonhosted.org/packages/f0/e3/214a14d630c9de9fba8b19d02aef51cf244075cfb99b0853458929689437/iotnetworkmalwareclassifier-0.0.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-04 10:47:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sergio11",
    "github_project": "iot_network_malware_classifier",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "iotnetworkmalwareclassifier"
}
        
Elapsed time: 0.23522s